Conditional Expressions

Conditional Expressions

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

Conditional Expressions

Conditional expressions use the conditional operators to compare operands (typically, value expressions). When evaluated, conditional expressions yield a logical result (true or false), depending if  the condition is satisfied.

Conditional Operators

OperatorCondition Being Evaluated
expr = exprThe values are equal.
expr <> exprThe values are not equal.
expr < exprThe left-hand value is less than the right-hand value.
expr <= exprThe left-hand value is less than or equal to the right-hand value.
expr > exprThe left-hand value is greater than the right-hand value.
expr >= exprThe left-hand value is greater than or equal to the right-hand value.
expr between expr and exprThe value before BETWEEN is greater than or equal to the value to the right of BETWEEN and less than or equal to the value to the right of AND.
expr not between expr and exprThe value before NOT BETWEEN is less than the value to the right of NOT BETWEEN and greater than the value to the right of AND.
expr in («expr»)The value before IN is a member of the list of values to the right of IN.
expr not in («expr»)The value before NOT IN is not a member of the list of values to the right of NOT IN.
expr is [$]nullThe value on the left is $Null.
expr is not [$]nullThe value on the left is not $Null.
expr like patternThe value before LIKE matches the pattern specified to the right of LIKE.
expr not like patternThe value before NOT LIKE matches the pattern specified to the right of NOT LIKE.

Note: The AND and BETWEEN expressions are not the Boolean AND.

Examples of Conditional Expressions

EmpNum > 1254

Logically true when EmpNum is 1254.

DepNum >= EmpNum

Logically true when DepNum is greater than or equal to EmpNum

FirstName = ‘Smith’

Logically true when FirstName is Smith.

DeptDesc <> ‘Sports’

Logically true when DeptDesc is anything but Sports.

EmpNum between 1000 and 2000

Logically true when EmpNum is in the range 1000-2000.

LastName like ‘% ith$’

Logically true when LastName matches the given pattern.

Event.EventName in (‘F1′,’F2′,’Escape’)

Logically true when EventName is in the list.

>ProdCode not between 542 and 863

Logically true when ProdCode is outside the range 542-863.

LastName not in (‘Smith’,’Jones’)

Logically true when LastName is not in the list.

FirstName not like ‘ Sm%’

Logically true when Firstname fails to match the pattern.
Simple conditional expression can be combined into more complex Boolean expressions by using Boolean operators. Also, the Boolean NOT can be used to achieve the same result as the NOT version of BETWEEN, LIKE, and IN.

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish