Hi, i have a simple table to store a event duration and have 3 column in the table: starttime, endtime, event if i want to search for an event which happen between 2010-01-12 12:00:00 to 2010-01-13 12:00:00 on the data below: starttime endtime event 2010-01-10 2010-01-14 Production 2010-01-12 2010-01-13 Standby if i use the query:"select * from [table] where starttime >='2010-01-12' or endtime <='2010-01-13'" , i only manage to get the second row data, however, the first event ('production' in this case) also fall into this period of time, may i know is there any query that can use to search for data that occur in a specific time period? Thanks.
$q = "SELECT * FROM table WHERE YEAR(date_field) = '2010' AND MONTH(date_field) = '01' AND DAY(date_field) = '12'";