Re: [SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Tom Lane
"Stijn Vanroye" <[EMAIL PROTECTED]> writes: > I can't seem to find a way to substract two time values (or > timestamp values) and get a numeric/float value. I always get the > INTERVAL datatype. extract(epoch from interval) may help. regards, tom lane

Re: [SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Bruno Wolff III
On Fri, Jun 04, 2004 at 10:11:57 +0200, Stijn Vanroye <[EMAIL PROTECTED]> wrote: > The working of the functions is not the problem, but the return type is. I can't > seem to find a way to substract two time values (or timestamp values) and get a > numeric/float value. I always get the INTERVAL

Re: [SQL] Difference between two times as a numeric value in a stored procedure. [Scanned]

2004-06-04 Thread Stijn Vanroye
> "Stijn Vanroye" <[EMAIL PROTECTED]> writes: > > I can't seem to find a way to substract two time values (or > > timestamp values) and get a numeric/float value. I always get the > > INTERVAL datatype. > > extract(epoch from interval) may help. > > regards, tom lane Indeed.

[SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Stijn Vanroye
Hello List, I am writing two stored procedure which alternatively returns the dayhours and nighthours of two times. (nighthours are considered between 00:00 and 06:00). As an example here is the getdayhours function: ---