EmersonH.Com

Transforming Knowledge into Power

  • Increase font size
  • Default font size
  • Decrease font size
Home VB 6 Date Date Add

Date Add

E-mail Print

Syntax:
DateAdd(interval, number, date)
The DateAdd function syntax has these parts:

Part Description

interval Required. String expression that is the interval of time that you want to add.

The string expression can be any of the following:

Expression Description
"yyyy" Year
"q" Quarter
"m" Month
"y" Day of year
"d" Day
"w" Weekday
"ww" Week
"h" Hour
"n" Minute
"s" Second
Note: To add days to date, you can use either "d", "y", or "w". Be advised that the term "weekday" ("w") has nothing to do with skipping weekend days; i.e., it is NOT equivalent to "business days". Applications that would require skipping weekend days (like Saturday and/or Sunday) would have to be custom coded.  number Required. Numeric expression that is the number of intervals you want to add. It can be positive (to get dates in the future) or negative (to get dates in the past). date Required. Date value that you want to evaluate.

Last Updated on Monday, 21 December 2009 16:56