age

Returns the age (in full years)

Syntax

age(dt_expr)

Arguments

dt_expr A date expression.

Description

Return the number of years from the dt_expr to the current date.

The data type DATE assumes the Gregorian calendar even for dates prior to the introduction of the Gregorian calendar. This means that databases that store historical dates prior to the introduction of the Gregorian calendar may not compute SELECT with date ranges, DAYOFWEEK, and WEEK correctly.

Example

select age(date "1956-05-03") as "Age";

        Age
         56