[NOT] BETWEEN
Compares one value to a specified range of values.
Syntax
expression [NOT] BETWEEN expr1 AND expr2
Parameters
expression | An expression that evaluates to either a number or a character string. |
expr1 | An expression that evaluates to either a number or a character string. |
expr2 | An expression that evaluates to either a number or a character string. |
Return Value
Logical
Comments
If any one of expression, expr1, and expr2 is a number, then a numeric comparison is made; otherwise, the comparison is character-based. Note that the AND in a BETWEEN comparison is not the Boolean AND.
A BETWEEN comparison is logically true if expression is greater than or equal to expr1, and less than or equal to expr2.
A NOT BETWEEN comparison is logically true if expression is either less than expr1, or greater than expr2.
Note: The AND in a BETWEEN comparison is not the Boolean AND.
Example
BioDiversity between 500 and 2000
Logically true if the value of BioDiversity lies between 500 and 2000 (inclusive).
See Also