You are viewing content for 5.1 | 5.0 | 4.9 | 4.8 | 4.7 | 4.6 | 4.5 | 4.4 | 4.3 | Previous Releases


daysBetween

Returns the number of days between two dates.

Example

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

daysBetween(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 number of days between the two dates.

Syntax

daysBetween(date expr day1, date expr day2)
  • day1: one end of the range as a date
  • day2: other end of the range as a date

Returns

int

Notes

Function daysBetween takes two arguments day1 and day2 and determines the number of days between them.

Note that day1 should be further ahead of in terms of time than day2. That is, day1 should be greater than day2.


© Incorta, Inc. All Rights Reserved.