DATE_BETWEEN
Description
DATE_BETWEEN determines whether the first date is between the second date and the third date.
The left boundary specified by the second date is inclusive and the right boundary specified by the third date is exclusive. Therefore the function returns 1 if the first date is in range [secondDate, thirdDate), and 0 otherwise.
Supported input column types: DATE
Output column type: INT, values 1 for true or 0 for false
Syntax
DATE_BETWEEN ( table.column1, table.column2, table.column3 )
NULL handling
If any parameter is NULL, the result is NULL as well.
Example
[1] DATE_BETWEEN of two rows. In both cases, the first date is between the second date and the third date | ||||||||||||||||
| ||||||||||||||||
|
[2] DATE_BETWEEN of two rows. In the first case the first date is equal to the second date and less than the third date. In the second case the first date is greater than the second date and equal to the third date. | ||||||||||||||||
| ||||||||||||||||
|