Updated lwap in queries.py to handle date start and end times properly