I have a table that contains fields start_date and end_date both in datetime format.
What I need to do is find all rows where a certain date falls between the start and end dates.
For example if I have these rows in my table I want to get all rows where start to end date would include 2011-12-08
start_date end_date
2011-12-01 09:00:00 2011-12-04 17:00:00
2011-12-07 15:00:00 2011-12-09 16:00:00
2011-12-08 10:30:00 2011-12-08 14:00:00
What is the best way of achieving this?
1 Answer