| Returns the DateAdd function. Returns the Variant (Date) that contains a Date. This Date is added with a time interval. Syntax DateAdd (interval, number, date) The DateAdd function syntax includes the following naming parameters: Partial description Interval is required. String expression, which is the time interval to be added. Number is required. A numeric expression is the number of time intervals to be added. The value can be a positive number (to get the future date) or a negative number (to get the past date ). Date is required. Variant (Date) or text that represents the Date, which is added with the time interval. Set The interval parameter has the following settings: Set description Yyyy Q quarter M month Y number of days in a year D Number of days per week Ww week H hour N minutes S seconds Description You can use the DateAdd function to add or subtract the specified time interval from the date. For example, you can use DateAdd to calculate the date of thirty days from the past day, or 45 minutes from now. To add "day" To date, you can use "day of the year" ("y"), "day" ("d ") or "number of days in a week" ("w "). The DateAdd function does not return a valid date. Add April 1 to the previous month in the following instances: DateAdd (m, 1, 31-Jan-95) In the preceding example, DateAdd returns January 1, February 28, 1995 instead of January 1, February 31, 1995. If date is January 1, January 31, 1996, because January 1, 1996 is a leap year, the return value is January 1, February 29, 1996. If the calculated date is later than 100 (the year minus the year beyond the year in the date), an error occurs. If number is not a Long value, the nearest integer is used for calculation. Note that the format of the DateAdd return value is determined by the Control Panel setting, rather than by the format passed to the date parameter. |