Skip to main content

PQL46 (PQL Function Library - CPM 4.6)

YEARS_BETWEEN

Applies to: CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 CELONIS 4.6

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] YEARS_BETWEEN of five rows.

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

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

Result

Column1 : FLOAT

0.0

0.41889977206924167

1.0020739645577939

2.001410022108599

0.9993360575508052

See also: