Date: Fri, 1 Jun 2001 11:14:51 -0400
Reply-To: Andy Kowalczyk <akowalczyk@WCRINET.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Andy Kowalczyk <akowalczyk@WCRINET.ORG>
Subject: Re: calculating dates
There is no generic answer - it is best left for you to program after
understanding the "business rules" of you application.
Consider from your example:
31dec2000 + 2 months -> 28feb2001
now consider
28dec2000 + 2 months -> 28feb2001
so what is the desired result of
28feb2001 + 2 months -> ???
do we want
31dec2000 -> 28feb2001 -> 30apr2001
or
28dec2000 -> 28feb2001 -> 28apr2001
Perhaps each of your dates need a corresponding "monthaversary" flag that
indicates that the day portion of a date should be interpretated as the
ACTUAL day, or the FIRST day, or the LAST day, or the FIFTEENTH, or the
first MONDAY, or LASTWORK day, or FIRSTWORK day, or whatever special uses
are required by the business.
Andy
On Fri, 1 Jun 2001 14:21:22 +0200, Chris Neubauer <water.world@GMX.DE>
wrote:
>Hi,
>
>is there a function for adding date-intervals to a given date, e.g.
>
>01jan2001 + 1 month -> 01feb2001
>31dec2000 + 2 months -> 28feb2001
>
>I tried the function intnx, but it returns not the values I expect, it
>returns either the beginning, end or middle of the month, but not exactly
>the date I expect.
>
>Thanks,
>Chris