Back

Relational operators

Introduction
Relational operators allow you to compare two values. The result will be either TRUE or FALSE.

Relational operators
The relational operators you should know are:

= equals. For example, the result of 5 = 5 is TRUE. 23 = 5 is FALSE.

<> not equals. For example, the result of 6 <> 6 is FALSE (6 is not equal to 6, so this is a true statement.) 23 <> 5 is TRUE.

< less than. For example, 4 < 6 is TRUE but 17 < 3 is FALSE.

<= less than or equal to. For example, 5 <= 7 is TRUE. 5 <= 5 is TRUE 5 <= 4 is FALSE.

> greater than. 10 > 5 is TRUE. 10 > 10 is FALSE. 10 > 20 is FALSE.

>= greater than or equal to. 20 >= 17 is TRUE. 20 >= 20 TRUE. 20 >=30 is FALSE.

If you get the greater than and less than signs mixed up, try remembering that the < symbol looks very like the L of Less than!

Back