Age function

Official Content
This documentation is valid for:

To calculate the difference, in years, between two date expressions.

Syntax

Age(date-expression1 | datetime-expression1 [ ,date-expression2 | datetime-expression2 ] )

Type returned:
Numeric N(4)

Description

Returns the difference, in years, between the two parameters (second parameter - first parameter). If the second parameter, which is optional, is omitted, then the default value depends on the first parameter’s data type:

1.  If it is Date type, then the default value is the value returned by the function Today().
2.  If it is Datetime type, then the default value is the value returned by the function Now().

If the first parameter is smaller than the second one, then Age function returns a positive value; otherwise, it returns a negative value.

Example

&Nbr = Age(&DateOfBirth)
&TxtAge = "Years old: " + Str(&Nbr)

Scope

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

See also

Age Method





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.