addmonth problem
GCC Consulting
gccconsulting at comcast.net
Tue Apr 29 11:04:31 PDT 2008
Ken,
Sorry for the miss type of the dates but should not addmonth using the last
day of February yield the last day of March?
Granted, EOM() will force this to happen.
Richard
> -----Original Message-----
> From: filepro-list-
> bounces+gccconsulting=comcast.net at lists.celestial.com [mailto:filepro-
> list-bounces+gccconsulting=comcast.net at lists.celestial.com] On Behalf
> Of Kenneth Brody
> Sent: Tuesday, April 29, 2008 1:53 PM
> To: rkreiss at gccconsulting.net
> Cc: 'filePro'
> Subject: Re: addmonth problem
>
> Quoting Richard Kreiss (Tue, 29 Apr 2008 13:36:52 -0400):
>
> > 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.
>
> No, it's not. The result is "03/29/2008", just as it should.
>
> > Now, I would have expected that date
> > to be 04/30/2008
>
> Why?
>
> > as 02/28/2007 yielded 04/30/2007.
>
> No, it doesn't. The result is "03/28/2007".
>
> > Now each succeeding month is the 29th and not the last day of the
> month.
>
> That is correct. One month from February 29 is March 29.
>
> > Now I could just do nd=eom(addmonth(td)) to insure the last day of
> the
> > month.
>
> If you want the last day of the month, then you need to use EOM() to
> force
> the end-of-month date.
>
> > 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.
>
> No bug here, nor does it "correct" anything with February 28.
>
> > Has this affected anyone else?
>
> --
> Read the truth behind the movie "Expelled" at
> <http://www.ExpelledExposed.com>
> --
> KenBrody at BestWeb dot net spamtrap:
> <g8ymh8uf001 at sneakemail.com>
> http://www.hvcomputer.com
> http://www.fileProPlus.com
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list