ADDDATE(t,a) and SUBDATE(t,a) are date functions that determine a date in the future or a date in the past.
Value t: When used in a function, the expression t (date_or_timestamp_expression) must supply a date, a time stamp, or an alphanumeric value that matches the current date or time stamp format.
Value a: The expression a (expression) supplies a numeric value that represents a number of days. Any decimal places in a are truncated if necessary.
t, a |
Result of the ADDDATE(t,a)/SUBDATE(t,a) Function |
---|---|
Addition of a to t or subtraction of a from t |
|
t or a is a NULL value |
NULL value |
a is a special NULL value |
Error message |
SQL Tutorial, Date and Time Calculations