Comparison Operators
In This Lesson, You Will Learn:
- How to evaluate two or more expressions using comparison operators.
- The difference between comparing numeric and text-based values.
Comparison operators are used to evaluate two operands, returning True if the condition is met, False if it is not, and Null if the condition cannot be evaluated. This type of operator can be used to compare any two objects so long as they are of comparable data types.
Expression | Symbol | Description | Example | Example Result |
---|---|---|---|---|
Equality | = | Returns True if the first value is equal to the second value | 1 = 2 | False |
Not Equal | <> | Returns True if the first value is not equal to the second value | 1 <> 2 | True |
Less than | < | Returns True if the first value is less than the second value | 1 < 2 | True |
Less than or equal | <= | Returns True if the first value is less than or equal to the second value | 1 <= 2 | True |
Greater than | > | Returns True if the first value is greater than the second value | 1 > 2 | False |
Greater than or equal | >= | Returns True if the first value is greater than or equal to the second value | 1 >= 2 | False |
<< Previous: Lesson Summary | Next: True and False: Binary Terms >>