in reply to Trying to select all records that match a datetime range.

I would agree that this is an SQL issue. A colleage showed me this trick the other day:
... AND START_TIME < $datetime_end AND END_TIME > $datetime_start
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.