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)

Type returned:
Date | DateTime

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

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

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.

Example

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

Scope

Objects   Procedure object, Transaction object, Web Panel object, Work Panel object

See also

AddYr function
AddMonths method
Add days syntax