DateAdd Function

LÀgger till ett datumintervall till ett givet datum ett antal gÄnger och returnerar det resulterande datumet.

Syntax:

DateAdd (TillÀgg, Antal, Datum)

ReturvÀrde:

En variant som innehÄller ett datum.

Parametrar:

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

TillÀgg (strÀngvÀrde)

Förklaring

Ă„Ă„Ă„Ă„

År

q

Kvartal

m

MĂ„nad

y

Dagen pÄ Äret

w

Weekday

ww

Vecka pÄ Äret

d

Dag

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.

Exempel:

Sub example_dateadd

    MsgBox DateAdd("m", 1, "1/31/2004") &" - "& DateAdd("m", 1, "1/31/2005")

End Sub