[thelist] sql query for sum of timediff

Canfield, Joel JCanfield at PacAdvantage.org
Fri Jun 2 11:03:20 CDT 2006


> select firstname, lastname,
>    SEC_TO_TIME( sum(TIME_TO_SEC(endtime)-TIME_TO_SEC(starttime)) )
> from presence
> where starttime between '2006-05-31 0:00:00' and '2006-05-31 
> 23:59:59';

bingo

SEC_TO_TIME and TIME_TO_SEC were lurking in the back of my mind and just
hadn't surfaced

vielen dank



More information about the thelist mailing list