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 these:
    • year - yyyy
    • month - m
    • week - ww
    • day - d
    • weekday - w
    • dayofyear - y
    • hour - h
    • minute - n
    • second - s
  • number is the value used to increment or decrement the datePart.

    To decrement or to 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.