DateAdd Function
Afig un interval de data en una data determinada un nombre de cops i torna la data resultant.
Sintaxi:
DateAdd (Add, Count, Date)
Valor de retorn:
Una Variant que conté una data.
Parà metres:
Add - A string expression from the following table, specifying the date interval.
|
Add (string value) |
Explicació |
|
yyyy |
Any |
|
q |
Trimestre |
|
m |
Mes |
|
y |
Dia de l'any |
|
w |
Dia feiner |
|
ww |
Setmana de l'any |
|
d |
Dia |
|
h |
Hora |
|
n |
Minut |
|
s |
Segon |
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.
Exemple:
Sub example_dateadd
MsgBox DateAdd("m", 1, "1/31/2004") &" - "& DateAdd("m", 1, "1/31/2005")
End Sub