DateAdd Function

Adds a date interval to a given date a number of times and returns the resulting date.

Sintaksa:

DateAdd (Add, Count, Date)

Vlerë absolute

Formati numerik: datë

Parametrat animues

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

Vlerë në zvoglim e kryerreshtit

Explanation

yyyy

Viti

q

Quarter

m

Muaj

y

Dita e parw e periudhws

w

WEEKDAY

ww

Week of year

d

Dita

h

ORA

n

MINUTA

s

SEKONDA


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.

Shembull

Sub example_dateadd

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

End Sub