Duration workdate clientid personid
60 2006-01-03 1 51
48 2006-01-03 2 51
167 2006-01-03 4 51
select SUM(duration) as totaltime, name from events left join clients on
(events.clientid=clients.clientid) where MONTH(events.workdate)=1 and
YEAR(events.workdate)=2006 and DAY(events.workdate)=3 and events.personid=51
group by events.clientid desc
I used this query and this give s me this result:
But what I need is a result like this:
So even the clients who have no entry in events on that day, but they have
an event in that specific month and year should be shown with a 0 value.
Any help really appreciated.
Thx in advance