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 calculation function

Re: Date calculation function

From: Frank Piron <empty_at_zero.nil>
Date: Thu, 13 Jan 2005 08:43:37 +0100
Message-ID: <opski6ezgcm0et4w@news.online.de>


Am Wed, 12 Jan 2005 17:10:42 GMT schrieb Randy Harris <randy_at_SpamFree.com>:

>> function Add_Weeks(Start_Date in date,
>> Weeks_To_Add in number) return date
>> is
>> begin
>> return Start_Date + Weeks_To_Add * 7;
>> end Add_Weeks;
>> /
>>
>> Regards,
>> --
>> Frank Piron,
>> defrankatkonaddot
>> (leftrotate two)
>
> Frank, am I interpreting this correctly? If I add an integer to a date,
> it
> assumes I am adding days and returns the date offset by that many days?

Yes, a (real) number in operations (+ or -) containing dates is interpreted as a *duration* . The unit of measure of duration is a day. So for example the difference of two dates date_1 - date_2 is the number of day between date_1 and date_2.

-- 
Frank Piron,
defrankatkonaddot
(leftrotate two)
Received on Thu Jan 13 2005 - 01:43:37 CST

Original text of this message

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