DateAdd Function
āĻāĻāĻāĻŋ āĻĒā§āϰāĻĻāϤā§āϤ āϤāĻžāϰāĻŋāĻā§ āĻā§ā§āĻāĻŦāĻžāϰ āϤāĻžāϰāĻŋāĻā§āϰ āĻŦāĻŋāϰāϤ⧠āϏāĻāϝā§āĻāύ āĻāϰāĻž āĻšā§ āĻāĻŦāĻ āĻĢāϞāĻžāĻĢāϞā§āϰ āϤāĻžāϰāĻŋāĻ āĻĒā§āϰāĻĻāĻžāύ āĻāϰā§āĨ¤
āϏāĻŋāύāĻā§āϝāĻžāĻā§āϏ:
DateAdd (Add, Count, Date)
āĻĒā§āϰāĻĻāĻžāύ āĻŽāĻžāύ:
āϤāĻžāϰāĻŋāĻ āϧāĻžāϰāĻŖāĻāĻžāϰ⧠āĻāĻāĻāĻŋ āĻā§āϰāĻŋā§ā§āύā§āĻāĨ¤
āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāĻāĻžāϰ:
Add - A string expression from the following table, specifying the date interval.
āϏāĻāϝā§āĻāύ (āϏā§āĻā§āϰāĻŋāĻ āĻŽāĻžāύ) |
āĻŦā§āϝāĻžāĻā§āϝāĻž |
yyyy |
āĻŦāĻāϰ |
q |
āĻāϤā§āϰā§āĻĨāĻžāĻāĻļ |
m |
āĻŽāĻžāϏ |
y |
āĻŦāĻāϰā§āϰ āĻĻāĻŋāύ |
w |
āĻāϰā§āĻŽāĻĻāĻŋāĻŦāϏ |
ww |
āĻŦāĻāϰā§āϰ āϏāĻĒā§āϤāĻžāĻš |
d |
āĻĻāĻŋāύ |
h |
āĻāύā§āĻāĻž |
n |
āĻŽāĻŋāύāĻŋāĻ |
s |
āϏā§āĻā§āύā§āĻĄ |
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