Use this function to add a specified number of days, months, and/or years to a date.
DateAdd (Date, Format, Days, Months, Years)
Parameter |
Description |
Date |
Enter a date string. The system assumes your entry to be in the format specified in the Format parameter. The default is the current date. |
Format |
Enter a date format string that describes the contents of the Date parameter. The default is date format 1 (MM/DD/YY). |
Days |
Enter the number of days. The default is zero (0). |
Months |
Enter the number of months. The default is zero (0). |
Years |
Enter the number of years. The default is zero (0). |
This function adds a specified number of days, months, and years to a given date. The result is formatted according to the Format parameter.
The Days, Months, and Years parameters can be negative or positive. If you enter a negative parameter, the system subtracts the specified days, months, or years.
You do not have to divide the values into components. For example, you can add 300 days and 40 months to a date. The result reflects the appropriate year, month, and day.
Here are some examples (assume the current date is 07/01/09):
© Copyright 2014, Oracle and/or its affiliates. All rights reserved. Legal notices.