Function documentationADDDATE/SUBDATE(t,a) Locate this document in the navigation structure

 

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.

ADDDATE(t,a)/SUBDATE(t,a)

t, a

Result of the ADDDATE(t,a)/SUBDATE(t,a) Function

Addition of a to t or subtraction of a from t

Date value or time stamp value

t or a is a NULL value

NULL value

a is a special NULL value

Error message

Example

SQL Tutorial, Date and Time Calculations