db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Kroeker" <raym...@thinkparity.com>
Subject Re: Sum of time
Date Wed, 18 Jul 2007 16:18:49 GMT
Can I ask why you wouldn't store the duration as a simple bigint
representing the number of seconds/milliseconds?

On 7/18/07, Dmitri Pissarenko <dmitri.pissarenko@gmail.com> wrote:
>
> 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/
>



-- 
--------------------------------------------------------------------------------
Raymond Kroeker
thinkParity Solutions Inc.

Mime
View raw message