db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Pissarenko" <dmitri.pissare...@gmail.com>
Subject Re: Sum of time
Date Wed, 18 Jul 2007 11:16:12 GMT
Hello!

> > SELECT PLACE, SUM(SECOND(DURATION) +
> > MINUTE(DURATION)*60 + HOUR(DURATION)*60*60)
> > FROM MyTable
> > GROUP BY PLACE
> >
> > But I still need to convert int to time.
>
> Out of curiosity, what happens if you add this int to the Time 00:00:00?

I don't add this int to any Time. That won't work.

Instead, first I convert this int (seconds) to

a) hours
b) minutes
c) seconds.

Then I create a string "hours:minutes:seconds" and parse it with TimeFormat.

Best regards

Dmitri Pissarenko

-- 
http://www.xing.com/profile/Dmitri_Pissarenko
http://dapissarenko.blogspot.com/

Mime
View raw message