Add two years to a given date.
SELECT DateAdd(“yyyy”, 2, #22/11/2017#); |
The DATEADD()
function adds a specified time/date interval to a given date and returns the resulting date.
DateAdd(interval, number, date) |
Parameter |
Description |
interval |
Mandatory. The time/date interval to add, which can be one of the following values:
|
date |
Mandatory. The number of intervals to add to the date. This can be positive (for future dates) or negative (for past dates). |
time |
Mandatory. The date to which the interval will be added. |
WORKS IN |
From Access 2000 |
Add one year to the current date.
SELECT DateAdd(“yyyy”, 1, Date()); |
Add six months to the birth dates of the employees.
SELECT LastName, DateAdd(“m”, 6, BirthDate) FROM Employees; |