Returns the number of days between two dates.
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.
daysBetween(date expr day1, date expr day2)
- day1: one end of the range as a
- day2: other end of the range as a
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.