[snip] WHICH startdate and enddate? You have not aliased those, so the query may be throwing odd results due to your joins. Typically MySQL sends an 'Empty set' message if there are no records. [/snip] That's probably it. Additionally, the data types of startdate and endate are DATETIME. Should they be TIMESTAMP or TIME? Rob