PDA

View Full Version : calculating date



grichey
09-21-2010, 03:05 PM
I have 2 fields, start date and length (months). I'm trying to set up a query to calculate ending date. I've tried searching and have found numerous suggestions on calculating the time between two dates but not going the other way.

Example Start date is 1/1/2010 and length is 24, the calculated field should be 12/31/2012.

Suggestions? Haven't used access in a couple yrs and trying to shake off the rust.

hansup
09-21-2010, 10:42 PM
The DateAdd() function seems close to what you're asking for. Debug.Print DateAdd("m", 24, #1/1/2010#)The problem is that expression returns 1/1/2012, but you indicated adding 24 months should result in 12/31/2012. However that result doesn't make sense to me because 12/31/2012 is one day short of 36 months after 1/1/2010.