Hello,
Wondering if anyone can help as i’m really confused. I want to run two dynamic queries in the same format for half an hour time slots to output all records in the database where the start time is between:
- 12.00pm and 12.30pm.
and - 12.30pm and 13.00pm.
So I have a record in my database where the estimated_start_time is 11:45pm and estimated_end_time is 12:45pm
Now if I run the query I have written for between 12.00pm and 12.30pm a result is returned:
SELECT * FROM `reps_schedule` WHERE estimated_start_time <= '2011-01-10 12:00:00' AND estimated_end_time >= '2011-01-10 12:30:00' AND user_id = 12
But that same style query it would not run for my 12.30pm and 13.00pm?
SELECT * FROM `reps_schedule` WHERE estimated_start_time <= '2011-01-10 12:30:00' AND estimated_end_time >= '2011-01-10 13:00:00' AND user_id = 12
Anyone kindly help?
Thanks