It would be helpful to know:
The definition of the tables involved (especially the types of the fields start_time and end_time
The contents of the fields for some records
The result of the query (database error or just wrong result?)
A more specific description of what you are trying to do (especially if the problem is a wrong result)