Comparison Operators
The following table shows the comparison operators you can use in your expressions. In the descriptions, expression 1 refers to the expression to the left of the operator and expression 2 refers the expression to the right of the operator.
Operator |
Symbol |
Meaning |
---|---|---|
Equality |
= |
Compares one expression against another to see if they are equal. It is True if expression 1 is equal to expression 2, otherwise it is False. |
Inequality |
<> |
Compares one expression against another to see if they are not equal. It is True if expression 1 is not equal to expression 2, otherwise it is False. |
Less than |
< |
Compares one expression against another to see if the first expression is less than the second expression. It is True if expression 1 is less than expression 2, otherwise it is False. |
Greater than |
> |
Compares one expression against another to see if the first expression is greater than the second expression. It is True if expression 1 is greater than expression 2, otherwise it is False. |
Less than or equal to |
<= |
Compares one expression against another to see if the first expression is less than or equal to the second expression. It is True if expression 1 is less than or equal to expression 2, otherwise it is False. |
Greater than or equal to |
>= |
Compares one expression against another to see if the first expression is greater than or equal to the second expression. It is True if expression 1 is greater than or equal to expression 2, otherwise it is False. |
- If both expressions are numeric, a numeric comparison is performed.
- If both expressions are strings, a string comparison is performed.
- If one expression is numeric and the other is a string, the numeric expression is treated as being less than the string expression.
- If one expression is empty and the other is numeric, a numeric comparison is performed with 0 being used as the empty expression.
- If one expression is empty and the other is a string, a string comparison is performed with a zero length string (' ') used as the empty expression.
- If both expressions are empty, the expressions are regarded as equal.
Further Information