DateAdd
The DateAdd() function adds an interval to a part of a date.
Related Functions: DatePart
Syntax
Dateadd (Part, Interval, Date)
Part |
The date part to add. Possible values: “w” or “week” (week) “d” or “day” (day) “m” or “month” (month) “y” or “year” (year) |
Interval | A numerical value that specifies how many date parts to add. A negative integer will subtract date parts. |
Date | Any date |
Examples
Description | Function | Output |
Add a year to a date | Dateadd(“y”, 1, “3 January 2015”) | 2016/01/03 12:00:00 AM |
Add two weeks to a date | Dateadd(“week”, 2, “3 March 2010”) | 2010/03/17 12:00:00 AM |
Subtract a day from a date | Dateadd(“d”, -1, “9 August 2014”) | 2014/08/08 12:00:00 AM |
Add three months to a date | Dateadd(“month”, 3, “2015/10/01”) | 2016/01/01 12:00:00 AM |