# this "works" (ie. finds projects that have timeentries >= 2006) SELECT up.project,name,path,t.* FROM `user_project` AS up JOIN project AS p on up.project = p.id LEFT JOIN timeentry AS t ON t.project = up.project AND t.user = up.user WHERE ((`start` >= '2006-01-01 00:00:00' ) OR `start` IS NULL) AND up.user = '1' AND p.customer = 'Koumbit' AND 1 ORDER by `path` # now this doesn't display projects that have no time entry in january 2006 SELECT up.project,name,path,t.* FROM `user_project` AS up JOIN project AS p on up.project = p.id LEFT JOIN timeentry AS t ON t.project = up.project AND t.user = up.user WHERE ((`start` >= '2006-01-01 00:00:00' AND `start` <= '2006-02-01 00:00:00' ) OR `start` IS NULL) AND up.user = '1' AND p.customer = 'Koumbit' AND 1 ORDER by `path` # what I want is to display a project wether or not it is in the timeentry table *but if it is*, find the timeentries that are only within a certain timerange