I have a table like this one:
Items start_datatime end_datatime
A1 2015-01-31 10:00:00 2015-02-02 20:30:00
A2 2015-02-04 16:00:00 2015-02-04 16:30:00
And i want to select items for a given datetime (ex: 2015-02-02).
So, i'm trying this query:
SELECT Items FROM table WHERE start_datatime >= 2015-02-02 00:00:00
AND end_datatime < 2015-02-03 00:00:00
In this example, i want to select item A1 when date is 2015-01-31, 2015-02-01 and 2015-02-02. And A2 when date is 2015-02-04.