Built-in Functions → daysBetweenInt

daysBetweenInt() is a scalar date function that returns the integer number of days between two dates.

Important

This function is available starting 6.0.1 release.

Note

The first parameter should be the later date while the second should be earlier.

Signature

daysBetween(date exp, date exp)

The following table illustrates the daysBetweenInt() parameters:

ParameterDescription
date exp (1)one end of the range as a date
date exp (2)other end of the range as a date

Returns

int

Example

Find the number of days between December 24, 2001 11:55:12.00 pm and December 20, 2001 11:55:12.00.

daysBetweenInt(timestamp("2001-12-24 23:55:12.000"),
timestamp("2001-12-20 23:55:12.000")))

In this example, the function returns 4 days, which is the integer number of days between the two dates.