I have a date that is used to show when someone completed a task and the task is due again in 12,24,48 months. I am trying to update a field for the next due date. Of course after I get this done, I will build a query report to show anyone that is going to be due again in the next 30 days.
How to update a date field based off of another date + x amount of months?
Collapse
X
-
David SnyderTags: None -
If OldDate is the date completed, and NewDate is the date due again:
The +1 is for 12 months.Code:NewDate=DateSerial(Year(OldDate)+1,DateSerial(Month(OldDate),Day(OldDate))
You will have to add some logic to check that the due date does not fall on an illegal date, like Feb 29 in a year that is not a leap year. Or just force all due dates to be the first or last day of a month my changing the Day parameter in the DateSerial function.
Jim -
David Snyder
Thanks Jim (more info please.
Ok.. so I have the formula to get the "Due" date, but it does not update the field in the table. It will show on the form, but it does not carry over into the table.Comment
Comment