In Access, the DateAdd function Adds a specified time interval to a date.
The syntax for the DateAdd function is:
DateAdd ( interval, number, date )
You can use the DateAdd function to add a specified time interval to or subtract a specified time interval from a date. For example, you can use DateAdd to calculate a date 15 days from today or a time that is 30 minutes from now.
interval is the interval of time you want to add to date. The following is a list of valid interval values.
|y||Day of year|
number is the number of intervals you want to add to date. It can be positive (to get dates in the future) or negative (to get dates in the past).
date is the date to which the interval is added.
This example takes a date and, using the DateAdd function, displays a corresponding date a specified number of days in the future. Now the MyNumber variable would contain the value of ‘01.23.1999’.
You can also use the DateAdd function in a query.