DateAdd Function

แƒแƒ›แƒแƒขแƒ”แƒ‘แƒก

แƒกแƒ˜แƒœแƒขแƒแƒฅแƒกแƒ˜

DateAdd (Add, Count, Date)

แƒ“แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ:

A Variant containing a date.

Parameters:

Add - A string expression from the following table, specifying the date interval.

Add (string value)

แƒแƒฎแƒกแƒœแƒ

yyyy

Year

q

Quarter

m

Month

y

Day of year

w

Weekday

ww

Week of year

d

Day

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