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

Home -> Community -> Usenet -> c.d.o.tools -> Re: ___DATE, DATE, DATE Subtraction

Re: ___DATE, DATE, DATE Subtraction

From: SATYA PAL <spgangwar_at_yahoo.com>
Date: Sat, 21 Jul 2001 21:17:42 GMT
Message-ID: <a7b8a58b.0106290338.5749c96e@posting.google.com>

Hi,

Select (sysdate &#8211; t1)*24*60*60 from t1;

You use the above query to subtract the dates. The result you will get in number of seconds. If you need the result in Days then do not multiply by 24*60*60.

Regards
Satya

"Spencer" <spencerp_at_swbell.net> wrote in message news:<kiy_6.309$ZD6.163408_at_nnrp3.sbc.net>...
> please refrain from cross posting to all oracle groups.
>
> subtracting one date expression from another date expression
> returns the number days between the date expressions, as a
> NUMBER, not DATE.
>
> HTH
>
> "Chris Chi" <stvllium_at_ms18.hinet.net> wrote in message
> news:9he8ve$skq_at_netnews.hinet.net...
> > Hi
> >
> > How can I subtract DATE variable by another DATE variable, as below :
> >
> > declare
> > StartDate DATE;
> > EndDate DATE;
> > ResultDate DATE;
> > XXX CHAR(10);
> > begin
> > ......
> > ResultDate := EndDate - StartDate; -- Subtraction
> > ......
> > XXX := TO_CHAR(ResultDate, '...');
> > end;
> >
> > Thanks
> >
> > Chris from Taiwan, R.O.C.
> >
> >
> >
> >
> >
> >
> >
Received on Sat Jul 21 2001 - 16:17:42 CDT

Original text of this message

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