DateAdd Add full month to a date

natep26

Registered User.
Local time
Today, 11:45
Joined
Oct 2, 2007
Messages
63
I am using the dateadd function to add and specified number of months to a date. However, I would like to add full months rather than an average number of days. For example if I have a date of 6/30/08, then I want to add 6 months to it and end up with 12/31/2008 rather than 12/30/2008.

Thanks for your help
 
DateAdd supports the addition of months. What problem are you having?

Quote from help file:
=DateAdd("m", 1, "31-Jan-04") Displays a date that is a month after 31-Jan-04, and since 2004 is a leap year, the expression will evaluate to 29-Feb-04.
 
I have the date 6/30/2008. If I add 6 months to it, I get 12/30/2008. I would like to get 12/31/2008 (the full month).

Is this possible? Or something I just have to live with?

Thanks
 
If you're always dealing with the last day of the month you can do this:
Code:
 DateAdd("m",1,[MyDate]+1)-1
 
Thanks...I think that worked on most of them. What's the logic behind that.
 
If it's the last day of the month, adding 1 gives you the first day of the next month. DateAdd will always give you the first day of the month when you add a month, so you then subtract 1 to get the last day of the preceding month.
 

Users who are viewing this thread

Back
Top Bottom