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