DateAdd Function

指定の日付に日付の間隔を何度か追加し、結果の日付を返します。

構文:

DateAdd (Add, Count, Date)

戻り値:

日付を含むバリエーション。

パラメーター:

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

Add (文字列値)

説明

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