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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateAdd issue 1

Status
Not open for further replies.

dheim70

Programmer
Sep 23, 2011
14
US
I've used this function before with success but today I created a query and it is returning the wrong date. I have the following as a calculated field in my query: Due DateX: DateAdd("m",9,"06/30/2011")

And is returning the following 03/30/2012 instead of the correct value 03/31/2012

Has anyone seen this before? I am using access 2007

Any help would be greatly appreciated!

Thanks D
 

Why would you say correct value is 03/31/2012? And not what you are getting: 03/30/2012

If you add 9 months to 03/[blue]30[/blue]/2011, you get 03/[blue]30[/blue]/2012


Have fun.

---- Andy
 


Ditto.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


It you want the last of the month, 9 months out, rather than just 9 months...
Code:
DateSerial(Year("06/30/2011"), Month("06/30/2011") + 10, 0)

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Yup, should have worded that better.

Thanks for the code Skip, that is what I needed.

much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top