[SQL] getting extract to always return number of hours

2010-01-05 Thread Chris
Hi, I'm trying to get extract() to always return the number of hours between two time intervals, ala: => create table t1(timestart timestamp, timeend timestamp); => insert into t1(timestart, timeend) values ('2010-01-01 00:00:00', '2010-01-02 01:00:00'); => select timeend - timestart from t

Re: [SQL] getting extract to always return number of hours

2010-01-05 Thread Rosser Schwarz
On Tue, Jan 5, 2010 at 6:33 PM, Chris wrote: > I'm trying to get extract() to always return the number of hours between two > time intervals, ala: SELECT extract(epoch from timeend - timestart) / 3600 from t1; rls -- :wq -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make c

Re: [SQL] getting extract to always return number of hours

2010-01-05 Thread Chris
Chris wrote: Hi, I'm trying to get extract() to always return the number of hours between two time intervals, ala: => create table t1(timestart timestamp, timeend timestamp); => insert into t1(timestart, timeend) values ('2010-01-01 00:00:00', '2010-01-02 01:00:00'); => select timeend - ti