Re: Sum of time

2007-07-19 Thread Mark Thornton
Dmitri Pissarenko wrote: On 7/18/07, Raymond Kroeker [EMAIL PROTECTED] wrote: Can I ask why you wouldn't store the duration as a simple bigint representing the number of seconds/milliseconds? This field must have time type because a report is based on it. The report is done with Crystal

RE: Sum of time

2007-07-19 Thread derby
-Original Message- From: Mark Thornton [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 2:38 AM To: Derby Discussion Subject: Re: Sum of time Dmitri Pissarenko wrote: On 7/18/07, Raymond Kroeker [EMAIL PROTECTED] wrote: Can I ask why you wouldn't store the duration

Re: Sum of time

2007-07-18 Thread Dmitri Pissarenko
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.

Re: Sum of time

2007-07-18 Thread Raymond Kroeker
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 [EMAIL PROTECTED] wrote: Hello! SELECT PLACE, SUM(SECOND(DURATION) + MINUTE(DURATION)*60 + HOUR(DURATION)*60*60) FROM MyTable GROUP BY PLACE

Re: Sum of time

2007-07-18 Thread Dmitri Pissarenko
On 7/18/07, Raymond Kroeker [EMAIL PROTECTED] wrote: Can I ask why you wouldn't store the duration as a simple bigint representing the number of seconds/milliseconds? This field must have time type because a report is based on it. The report is done with Crystal Reports and I need the duration

Sum of time

2007-07-17 Thread Dmitri Pissarenko
Hello! I have a table with with time fields. That is, each record has a) field place (string) and b) field duration (time). I want to run a query like this SELECT PLACE, SUM(DURATION) FROM MyTable GROUP BY PLACE But I'm getting following error message: SQL State = 42Y22 SQL Code = 3 SQL

Re: Sum of time

2007-07-17 Thread Peter Ondruska
Well, first of all: what do you expect as a value for (Date)A + (Date)B ? What you want is an interval (perhaps in seconds) instead of time as duration. p. On 17.7.2007, at 9:57, Dmitri Pissarenko wrote: Hello! I have a table with with time fields. That is, each record has a) field

RE: Sum of time

2007-07-17 Thread Pertti Ylijukuri
Maybe easiest way is use big int type in duration field and store duration time in milliseconds -Original Message- From: Dmitri Pissarenko [mailto:[EMAIL PROTECTED] Sent: 17. heinäkuuta 2007 11:08 To: Derby Discussion Subject: Re: Sum of time Hello! On 7/17/07, Peter Ondruska [EMAIL

Re: Sum of time

2007-07-17 Thread Daniel Noll
On Tuesday 17 July 2007 18:03:43 Dmitri Pissarenko wrote: Hello! One obvious way is to use this: 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