Focal Point
Focus - date computation

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2791065112

February 05, 2007, 08:29 AM
manash
Focus - date computation
It might be a simple query, but due to lack of manual i am facing this problem, moreover i m using focus for first time, so can anyone help.

I have a date field in the input file in the format YMD and I need to add one year to it
what i did is:

define file f1
newdate/ymd=olddate +365

but how do i handle leap years in this case.
can there be other simple way of adding one year to input date field which takes care of the leap year.


FOCUS 7.1.1/ MF(OS/390)
February 05, 2007, 09:19 AM
codermonkey
There's a DATEADD function:
NEWDATE/YMD = DATADD(OLDATE, 'Y', 1);

Since you have a web connection you can go to the IB tech support website and download manuals for additional info.
February 05, 2007, 09:22 AM
FrankDutch
the manuals can be downloaded in PDF. very good to use that you can search in teh manual first.

but here is the answer

DATEADD(OLDDATE, 'Y', 1)

and you can understand what it would be if you want to add a month or a day or want to substract a day or a month or a business day.

good luck




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7