Simple question (I'd believe)
I have a bunch of data from some employees, I have the time the clock in and the time they clock out. I want to know how many hours each employee has worked over a period of time (i.e. a month).
I was trying to use some MySQL functions but I couldn't get them to work.
Here's an example of the data I have on the DB:
id employee_id myDate time_in time_out
24581 1111 7/20/2009 12:00:00 AM 13:55:00 19:55:00
24582 2222 7/25/2009 12:00:00 AM 3:58:00 6:35:00
24583 1111 7/21/2009 12:00:00 AM 14:05:00 19:59:00
24584 3333 7/24/2009 12:00:00 AM 8:00:00 13:25:00
24585 2222 7/30/2009 12:00:00 AM 14:01:00 16:55:00
where id and employee_id are INTs, date is a DATE, time_in and time_out are TIMEs
I was trying to SUM the TIMEDIFFs between time_in and time_out and then GROUP BY employee_id, but I couldn't get it to work
Any help would be appreciated.
Thanks in advance!