addmonth problem

Richard Kreiss rkreiss at gccconsulting.net
Tue Apr 29 10:36:52 PDT 2008


Not sure if this a bug or a programming error.

I have a routine which creates a number of records based on dates.  The date
is the last day of the month and I use addmonth to get the next months date.

Nd=addmonth(td)

Now this has worked just fine for the last 2 years.  He is the problem, this
year is a leap year and when the program went to create the April record
with td(10,mdyy/)="02/29/2008" the result is

 Nd=addmonth(td) and nd is 04/29/2008.  Now, I would have expected that date
to be 04/30/2008 as 02/28/2007 yielded 04/30/2007.

Now each succeeding month is the 29th and not the last day of the month.

Now I could just do nd=eom(addmonth(td)) to insure the last day of the
month.

But this appear to be a bug in that addmonth is not taking into account feb
29th and correcting April's date to the 30th as it does with Feb. 28th.

Has this affected anyone else?


Richard Kreiss
GCC Consulting
rkreiss at gccconsulting.net
  







More information about the Filepro-list mailing list