age()

Read(273) Label: time, interval, year, month, day,

Description:

Compute the number of whole years between a specified date and the current time

Syntax:

age(dateExp{, formatExp })

age(stringExp,formatExp)  

Note:

The function computes the number of whole years between the date specified by parameter dateExp and the current time

Parameters:

dateExp

Date expression whose result is the date

stringExp

String expression whose result must be a date or datetime format string

formatExp

Format expression, such as "yyyyMMdd","yyyy-MM-dd"

Options:

@y

The result is accurate to the year

@m

The result is accurate to the month

The computation is accurate to the day by default

Return value:

An integer

Example:

age(date("1980-09-01"))

 

age@m(datetime("1980-09-01 12:23:56"))

 

age@y("19800227","yyyyMMdd")