Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateAdd Function Error

Status
Not open for further replies.

bradmaunsell

Programmer
May 8, 2001
156
US
I have an error regarding the DateAdd function. I tried this with Access 97 and Access 2000 and get the same results. Am I missing something?

MsgBox DateAdd("m", 1, "31-jan-00") returns 2/29/00 (Correct)
MsgBox DateAdd("m", 1, "31-jan-01") returns 2/28/01 (Correct)

But....
MsgBox DateAdd("m", 1, "30-apr-02") returns 5/30/02 (Why not 5/31/02?)

also
MsgBox DateAdd("m", 1, "30-sep-02") returns 10/30/02 (Why not 10/31/02?)

It acts like it dosen't know the number days for every month.

Thanks,
Brad Maunsell
South Burlington, VT




 
Forget this one - must of experienced a senior moment!

I was expecting it to add and result in the next month-end, which of course it not what is is intented to do.

Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top