[SOLVED] Calculate Date in 5, 10, 15, 20 years Increment
I ordered "(Almost) 1001 Ways to Work with Dates in WebFocus" but in the meantime, I would like to know how you calculate the anniversary date (MDYY format) in 5, 10, 15, 20 etc. increment from the Start Date (MDYY Format). Can anybody show me how? I would appreciate it greatly! I use WebFocus 8.
Thanks, joykairosThis message has been edited. Last edited by: Kerry,
WebFocus Managed Reporting, Developer Studio
November 29, 2010, 01:27 PM
GamP
Something like this perhaps? There may be more than this one method ...
DEFINE FILE CAR
NOW/MDYY = '&MDYY';
ANNIV1/MDYY = DATEADD(NOW,'Y',5);
ANNIV2/MDYY = DATEADD(NOW,'Y',10);
ANNIV3/MDYY = DATEADD(NOW,'Y',15);
ANNIV4/MDYY = DATEADD(NOW,'Y',20);
ANNIV5/MDYY = DATEADD(NOW,'Y',25);
END
TABLE FILE CAR
PRINT NOW ANNIV1 ANNIV2 ANNIV3 ANNIV4 ANNIV5
BY COUNTRY
BY CAR
END