AddToDate
Mon 01 January 2018Syntax
AddToDate(date, num_years, num_months, num_days)
Description
Use the AddToDate function to add the specified number of years, months, and days to the date provided.
Suppose, for example, that you want to find a date six years from now. You could not just multiply 6 times 365 and add the result to todayâs date, because of leap years. And, depending on the current year, there may be one or two leap years in the next six years. AddToDate takes care of this for you.
You can subtract from dates by passing the function negative numbers.
Parameters
Field or Control |
Definition |
---|---|
date |
The input date to be adjusted. |
num _ years |
The number of years by which to adjust the specified date . num _ years can be a negative number. |
num_months |
The number of months by which to adjust the specified date . This parameter can be a negative number. |
num_days |
The number of days by which to adjust the specified date . This parameter can be a negative number. |
Returns
Returns a Date value equal to the original date plus the number of years, months, and days passed to the function.