Re: [SQL] interval as hours or minutes ?

2007-02-08 Thread Aarni Ruuhimäki
Ahh, Forgot about trunc() in the midst of all this ... Thank you guys again ! Aarni On Thursday 08 February 2007 12:06, Bart Degryse wrote: > Use trunc instead of round. > Also take a look at ceil and floor functions > > >>> Aarni Ruuhimäki <[EMAIL PROTECTED]> 2007-02-08 11:01 >>> > > On Thursd

Re: [SQL] interval as hours or minutes ?

2007-02-08 Thread Bart Degryse
Use trunc instead of round. Also take a look at ceil and floor functions >>> Aarni Ruuhimäki <[EMAIL PROTECTED]> 2007-02-08 11:01 >>> On Thursday 08 February 2007 00:09, you wrote: > select extract(epoch from (timestamp '2007-02-07 16:24:00' - timestamp > '2007-02-05 13:00:01'))/60 as minutes; > >

Re: [SQL] interval as hours or minutes ?

2007-02-08 Thread Aarni Ruuhimäki
On Thursday 08 February 2007 00:09, you wrote: > select extract(epoch from (timestamp '2007-02-07 16:24:00' - timestamp > '2007-02-05 13:00:01'))/60 as minutes; > >      minutes > -- >  3083.983 > (1 row) > > select round(extract(epoch from (timestamp '2007-02-07 16:24:00' -

Re: [SQL] interval as hours or minutes ?

2007-02-07 Thread Jan Muszynski
On 7 Feb 2007 at 19:03, Aarni Ruuhimäki wrote: > Hi all, > > Could anyone please tell an easy way to get total hours or minutes from an > interval ? > > SELECT SUM(stop_date_time - start_date_time) AS tot_time FROM work_times WHERE > user_id = 1; > tot_time > - > 2 days 14:08:

Re: [SQL] interval as hours or minutes ?

2007-02-07 Thread Bruno Wolff III
On Wed, Feb 07, 2007 at 19:03:35 +0200, Aarni Ruuhimäki <[EMAIL PROTECTED]> wrote: > > Could anyone please tell an easy way to get total hours or minutes from an > interval ? Extract the epoch from the interval and divide by the number of seconds in the period of time that applies and apply ap

Re: [SQL] interval as hours or minutes ?

2007-02-07 Thread A. Kretschmer
am Wed, dem 07.02.2007, um 19:03:35 +0200 mailte Aarni Ruuhimäki folgendes: > Hi all, > > Could anyone please tell an easy way to get total hours or minutes from an > interval ? > > SELECT SUM(stop_date_time - start_date_time) AS tot_time FROM work_times > WHERE > user_id = 1; Perhaps. You c

Re: [SQL] interval as hours or minutes ?

2007-02-07 Thread Bricklen Anderson
Aarni Ruuhimäki wrote: Hi all, Could anyone please tell an easy way to get total hours or minutes from an interval ? SELECT SUM(stop_date_time - start_date_time) AS tot_time FROM work_times WHERE user_id = 1; tot_time - 2 days 14:08:44 I'd like to have this like ... AS

[SQL] interval as hours or minutes ?

2007-02-07 Thread Aarni Ruuhimäki
Hi all, Could anyone please tell an easy way to get total hours or minutes from an interval ? SELECT SUM(stop_date_time - start_date_time) AS tot_time FROM work_times WHERE user_id = 1; tot_time - 2 days 14:08:44 I'd like to have this like ... AS tot_hours ... tot_hour