DateAdd() |
Top Previous Next |
DateAdd() - Change a Date by a Specified Time Interval Description The DateAdd() function allows you to change a date by adding to or reducing it by a specified time interval. For example, calculate the date 9 days ago. Date = DateAdd(interval, amount, date) Parameters
The amount parameter specific the number interval to increase or decrease the date by. Postive numbers increase to future dates, negative numbers decrease to past dates. The date parameter specifies the starting date to change. This can either be a date variable or a formatted date string. Example NewDate = DateAdd("m", 1, "3-Feb-2000") 'returns 3-Mar-2000
NewDate = DateAdd("yyyy", 2, "April 7, 1999") 'returns 7-Apr-2001
NewDate = DateAdd("d", -9, Date()) 'returns the date 9 days ago |