Skip to main content

Celonis Product Documentation

YEARS_BETWEEN
Description

YEARS_BETWEEN computes the difference between two dates in years.

Supported input column types: DATE

Output column type: FLOAT

Syntax
 YEARS_BETWEEN ( table.column1, table.column2 )
NULL handling

If any parameter is NULL, the result is NULL as well.

Example

[1]

Simple YEARS_BETWEEN example.

Query

Column1

         YEARS_BETWEEN ( "Table1"."Column1" , "Table1"."Column2" )
        

Input

Output

Table1

Column1 : date

Column2 : date

Fri Dec 31 1999 23:59:59.000

Fri Dec 31 1999 23:59:59.000

Fri Dec 31 1999 23:59:59.000

Thu Jun 01 2000 00:00:00.000

Thu Jun 01 2000 00:00:00.000

Fri Dec 31 1999 23:59:59.000

Fri Dec 31 1999 23:59:59.000

Sun Dec 31 2000 00:00:00.000

Fri Dec 31 1999 23:59:59.000

Mon Dec 31 2001 00:00:00.000

Sun Dec 31 2000 00:00:00.000

Mon Dec 31 2001 00:00:00.000

null

Mon Dec 31 2001 00:00:00.000

Thu Jun 01 2000 00:00:00.000

null

null

null

Result

Column1 : float

0.0

0.416

-0.416

1.0

2.0

1.0

null

null

null

See also: