I want to summarize the time difference to show the total number of hours a volunteer has worked. Getting the resulting set of time differences is easy:
Select timediff(timeOut, timeIn)
FROM volHours
WHERE username = 'skolcz'
which gives a list of times by the hour, but then I want to sum it up to the total.
So, if the result set is:
12:00:00
10:00:00
10:00:00
08:00:00
It is only 40 hours.
This is a way to do something like:
SELECT SUM(Select timediff(timeOut,timeIn)
FROM volHours
WHERE username = 'skolcz') as totalHours
?
source
share