DATEADD (SSIS)
Returns a new DT_DBTIMESTAMP value after adding a number that represents a date or time interval to the specified datepart in a date. The number parameter must evaluate to an integer, and the date parameter must evaluate to a valid date.
The following table lists the dateparts and abbreviations recognized by the expression evaluator. Datepart names are not case sensitive.
| Datepart | Abbreviations |
|---|---|
|
Year |
yy, yyyy |
|
Quarter |
qq, q |
|
Month |
mm, m |
|
Dayofyear |
dy, y |
|
Day |
dd, d |
|
Week |
wk, ww |
|
Weekday |
dw, w |
|
Hour |
Hh |
|
Minute |
mi, n |
|
Second |
ss, s |
|
Millisecond |
Ms |
The number argument must be available when the expression is parsed. The argument can be a constant or a variable. You cannot use column values because the values are not known when the expression is parsed.
The datepart argument must be enclosed by quotation marks.
A date literal must be explicitly cast to one of the date data types.
DATEADD returns a null result if the argument is null.
Errors occur if a date is invalid, if the date or time unit is not a string, or if the increment is not a static integer.
Reference
DATEDIFF (SSIS)DATEPART (SSIS)
DAY (SSIS)
MONTH (SSIS)
YEAR (SSIS)