MicroStrategy ONE

DaysBetween

Returns the difference in days between two given dates as an integer value. The calculation of the difference is based on the number of day boundaries crossed, and not the number of twenty-four hours periods elapsed. If the first date argument is later than the second date argument, the result is a negative number. The result does not display the time stamps as they are truncated before performing the calculation.

Syntax

DaysBetween(Date/Time1, Date/Time2)

Where

Date/Time1 is the start date and Date/Time2 is the end date.

For information on the syntax used in your specific database, refer to the Functions Reference.

Examples

DaysBetween('2024-07-29', '2024-07-25') = -4

DaysBetween('2024-07-29 02:00:00', '2024-07-31 01:00:00') = 2