Skip to main content

Celonis Product Documentation

MONTHS_BETWEEN
Description

MONTHS_BETWEEN computes the difference between two dates in months.

Supported input column types: DATE

Output column type: FLOAT

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

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

Example

[1]

Simple MONTHS_BETWEEN example.

Query

Column1

         MONTHS_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

Sat Jan 15 2000 00:00:00.000

Sat Jan 15 2000 00:00:00.000

Fri Dec 31 1999 23:59:59.000

Fri Dec 31 1999 23:59:59.000

Mon Jan 31 2000 00:00:00.000

Fri Dec 31 1999 23:59:59.000

Fri Dec 31 2010 00:00:00.000

Mon Jan 31 2000 00:00:00.000

Fri Dec 31 2010 00:00:00.000

Result

Column1 : float

0.0

0.5

-0.5

1.0

132.0

131.0

See also: