AddYears method

Official Content
This documentation is valid for:

Adds a given number of years to a given date.

Syntax

date-expression | datetime-expression , numeric-expression.AddYears(numeric-expression)

Where:
date-expression | datetime-expression 
     Given date or datetime.

numeric-expression
     The number of years added to the date-expression | datetime-expression.

Type returned:
Date | DateTime

Scope

Objects:  Procedure, Transaction, Web Panel, Work Panel

Description

Returns a value which results from adding numeric-expression years to date-expression or datetime-expression. When the type assigned is date, it returns a date value and when the type assigned is datetime, it returns a datetime.

Samples

If &Today.Month() = 12
   &ExpiryDate = &Hoy.AddYears(1)
EndIf   
&TxtExpiry = "Expiry date: " + DtoC(&ExpiryDate)

See Also

AddYr function
AddMonths method
Add days syntax