in reply to Trying to select all records that match a datetime range.
This includes all records that start or end within the period or that span it entirely without the need for OR conditions. Of course, I should make the obligatory comment that you should consider using placeholders - see The fine art of database programming - rather than including the values directly in your SQL string.... AND START_TIME < $datetime_end AND END_TIME > $datetime_start
|
|---|