Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to add or subtract 10 minutes from a date?

Re: How to add or subtract 10 minutes from a date?

From: Hakan Eren <heren_at_home.com>
Date: Fri, 11 Feb 2000 20:33:00 GMT
Message-ID: <38A47242.F4647F98@home.com>


Hi,

An example:

SQLWKS> alter session set nls_date_format = 'YYYY MM DD HH24:MI:SS'

     2> /
Statement processed.
SQLWKS> select sysdate from dual

     2> /
SYSDATE             
--------------------

2000 02 11 15:33:22
1 row selected.
SQLWKS> select sysdate+(1/24/60)*10 from dual

     2> /
SYSDATE+(1/24/60)*10



2000 02 11 15:43:22
1 row selected.
SQLWKS> select * from v$version
     2> /
BANNER                                                          
----------------------------------------------------------------
Oracle7 Server Release 7.3.4.5.0 - Production                   
PL/SQL Release 2.3.4.5.0 - Production                           
CORE Version 3.5.4.0.0 - Production                             
TNS for 32-bit Windows: Version 2.3.4.0.0 - Production          
NLSRTL Version 3.2.4.0.1 - Production                           
5 rows selected.

Ken Sproule wrote:
>
> Thanks in advance everyone.
>
> Assume I have a date like '12/31/99 11:59:30' and I want to add 10
> Minutes to it.
> I need to do this in s cursor select in a Before Insert Trigger that
> goes like:
> CURSOR cur is select * from xxxx X where X.dateAndTime <
> :(new.DateTime - 10 Minutes);
>
> I haven't been very successful in figuring it out. A worse date would
> be '02/28/00 11:59:30' + 10 minutes.
>
> How can I do this?
>
> Best,
>
> Ken Sproule
> kenmn_at_tds.net
>
> Ken Sproule
> kenmn_at_tds.net
Received on Fri Feb 11 2000 - 14:33:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US