Re: formating interval question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mike <mike(at)bristolreccc(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: formating interval question
Date: 2004-09-24 14:37:31
Message-ID: 21534.1096036651@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mike <mike(at)bristolreccc(dot)co(dot)uk> writes:
> I have an interval field which is used to calculate total hours.
> At present it outputs as days hours minutes
> Is there any way to output as total hours

You could always EXTRACT(EPOCH ...) to get total seconds and then
divide. I am not sure whether EXTRACT(HOUR ...) would give the
same answer, or just the hours portion of the normal printout.
But anyway, see EXTRACT.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message joseph speigle 2004-09-24 15:09:35 Re: How to pass initdb LC_COLLATE & locale parameters when using wind ows? (with or without pginstaller)
Previous Message Tom Lane 2004-09-24 14:32:16 Re: Large arrays give long lag on server side before command executes