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: Date function needed

Re: Date function needed

From: <jejurkar_at_my-dejanews.com>
Date: Thu, 02 Jul 1998 00:37:28 GMT
Message-ID: <6neko9$orh$1@nnrp1.dejanews.com>


In article <6nafmp$csp$1_at_nnrp1.dejanews.com>,   klausk_at_my-dejanews.com wrote:
>
> Hi,
>
> I'm looking for a function to add or subtract days to a given date (usually
> sysdate), and have the new date returned:
>
> add 1000 days to sysdate is: ???? <in date format>
> add -545 days to sysdate is: ???? <in date format>
>
> in Transact SQL there is a date_add function, which allows to add integer
> values to each specified datepart, Oracle unfortunately hasn't.
>
> the add_months function doesn't fullfil the requirements
>
> Every help appreciated !
>
> Thx
>
> Klaus Kloeser
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>

You can directly subtract the desired number of days from the date variable.

For example, (sysdate - 545) will give u the date 545 days ago.

Sameer

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Wed Jul 01 1998 - 19:37:28 CDT

Original text of this message

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