Lets say this my table like below.
ID | Startdate | Enddate
-----------------------------------------------
1 | 2012-12-12 08:00:00 | 2012-12-15 18:30:00
-----------------------------------------------
2 | 2012-12-11 00:00:00 | 2012-12-16 00:00:00
-----------------------------------------------
3 | 2012-12-16 08:00:00 | 2012-12-17 18:30:00
-----------------------------------------------
4 | 2012-12-13 00:00:00 | 2012-12-14 11:30:00
-----------------------------------------------
the selected date range is Id 1, 2012-12-12 08:00:00 to 2012-12-15 18:30:00 .
I wanna select any date which will across the date range.
The correct Id will be, 2 and 4 .
Hope you guys understand, if any question please feel free to ask.
Thank you.
1 Answer