DATEADD
Returns a new datetime value based on adding an interval to the specified
date.
NOTE: This function
is equivalent to DATEADD in T-SQL.
Return Value
Date/Time
Syntax
DATEADD( datePart, number, date )
where:
- datePart is the argument that
specifies on which part of the date to return a new value. Possible
values for this argument include the following:
- year, yy, yyyy
- quarter, q, qq
- month, m, mm
- week, wk, ww
- day, d, dd
- weekday, dw
- dayofyear, dy, y
- hour, hh
- minute, mm, n
- second, ss, s
- millisecond, ms
- number is the value used to
increment or decrement the datePart.
To decrement (that is, return an earlier date or time), use a negative
number.
If you specify a value that is not an integer, the fractional part of
the value is discarded. For example, if you specify day for datePart
and 1.75 for number, the date is incremented by 1.
- date is an expression that returns
the Date/Time value that you want to change.