May 17, 200421 yr Hello. What is the way to add month(s) and year(s) to a date. For example: - Add 1 month to a date 5/17/2004; - Add 3 months to a date 5/17/2004; - Add 6 months to a date 5/17/2004; - Add 1 year to a date 5/17/2004; - Add 2 years to a date 5/17/2004; - Add 3 years to a date 5/17/2004. I am adding a number of days (5/17/2004 + 180 (6 months)), but the new date is slightly off by several days beacause of the obvious reason. Thank you in advance for help on this one.
May 17, 200421 yr Date( Month( field ) + A, Day( field ), Year( field ) + B ) where A is the number of months to add and B the number of years to add.
May 17, 200421 yr Look at the Date() function. Date ( month, day, year) -Add 1 month to a "Date_" field. Date ( Month(Date_) + 1, Day(Date_), Year(Date_) ) - Add 1 year. Date ( Month(Date_), Day(Date_), Year(Date_) +1 ) It's smart about such things as advancing the year automatically when adding days or months, dealing with leap years, etc..
Create an account or sign in to comment