Re: Oracle Time Subtraction???

From: <pberetta_at_my-deja.com>
Date: Sun, 16 Jan 2000 12:38:31 GMT
Message-ID: <85se46$c6g$1_at_nnrp1.deja.com>


Pete,
  In Oracle dates, time is a fraction of a day, a second is 1/84600, so you can add/subtract the fractional 15/84600 to achieve the result you need - as in

SQL> select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'),
  2         to_char((sysdate + (15/84600)),'MM/DD/YYYY HH24:MI:SS'),
  3         to_char((sysdate - (15/84600)),'MM/DD/YYYY HH24:MI:SS')
  4 from dual;

TO_CHAR(SYSDATE,'MM TO_CHAR((SYSDATE+(1 TO_CHAR((SYSDATE-(1

------------------- ------------------- -------------------
01/16/2000 07:37:14 01/16/2000 07:37:29 01/16/2000 07:36:59

Hope this helps,
Paul

In article <85ritk$qku$1_at_nnrp1.deja.com>,   plburris_at_my-deja.com wrote:
> Does anyone know how to obtain "now - 15 minutes" using SQL or PL/SQL?
>
> I've tried various things with SYSDATE without success! Please help
if
> you can.
>
> Thanks,
> Pete
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sun Jan 16 2000 - 13:38:31 CET

Original text of this message