ADDDATE(t,a) and SUBDATE(t,a) are
date functions that calculate a date in the future or past.t:
date or timestamp expressiona: numeric value that represents the number of days. Any decimal places in a are truncated if necessary.
|
Result of the ADDDATE(t,a)/SUBDATE(t,a) function | |
Addition of a to t/ |
Date value or time stamp value |
t or a is NULL value |
NULL value (see data type) |
a is special NULL value |
Error message |

Model table:
Increasing a reservation date by two days
SELECT arrival, ADDDATE(arrival,2) arrival2, rno
FROM reservation WHERE rno = 130
ARRIVAL |
ARRIVAL2 |
RNO |
02/01/1999 |
02/03/1999 |
130 |