AddYears Function

  • Updated

The AddYears function adds a specified number of years to a DateTime value.

Syntax

 

The AddYears function adds a specified number of years to a DateTime value.

 

AddYears(dateTime, numYears)

 

 

Arguments:

 

 

 

dateTime

DateTime - The base date and time.

 

 

numYears

Integer - The number of years to add. A negative value will subtract years.

Remarks

  • Example: AddYears("5/1/2000",2) returns 5/1/2002.
  • Example: AddYears("5/1/2000",-2) returns 5/1/1999.

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.