DateAdd Function
Adds a date interval to a given date a number of times and returns the resulting date.
Syntax:
DateAdd (Add, Count, Date)
рд╡рд╛рдкрд╕реА рдореВрд▓реНрдп:
A Variant containing a date.
рдкреИрд░рд╛рдореАрдЯрд░
Add - A string expression from the following table, specifying the date interval.
|
Add (string value) |
рд╕реНрдкрд╖реНрдЯреАрдХрд░рдг |
|
yyyy |
рд╡рд░реНрд╖ |
|
q |
Quarter |
|
m |
рдорд╣реАрдирд╛ |
|
y |
Day of year |
|
w |
рд╕рдкреНрддрд╛рд╣ рдХреЗ рджрд┐рди |
|
ww |
Week of year |
|
d |
рджрд┐рди |
|
h |
Hour |
|
n |
Minute |
|
s |
Second |
Count - A numerical expression specifying how often the Add interval will be added (Count is positive) or subtracted (Count is negative).
Date - A given date or the name of a Variant variable containing a date. The Add value will be added Count times to this value.
рдЙрджрд╛рд╣рд░рдг:
Sub example_dateadd
MsgBox DateAdd("m", 1, "1/31/2004") &" - "& DateAdd("m", 1, "1/31/2005")
End Sub