Creating a Logical Expression
A logical expression determines whether a particular condition is true. There are two kinds of logical expressions: relational and Boolean. The entities to be compared determine the kind of expression used:
- A relational expression returns TRUE or FALSE based on a comparison of two individual values (either field values or constants).
- A Boolean expression returns TRUE or FALSE based on the outcome of two or more relational expressions.
You can use a logical expression to assign a value to a numeric field. If the expression is true, the field receives the value 1. If the expression is false, the field receives the value 0.
Logical Operators
The following is a list of common operators used in logical expressions. For information on relational operators and additional operators available for record selection using WHERE and IF, see Selecting Records for Your Report.
|
Operator |
Description |
|---|---|
EQ |
Returns the value TRUE if the value on the left is equal to the value on the right. |
NE |
Returns the value TRUE if the value on the left is not equal to the value on the right. |
GE |
Returns the value TRUE if the value on the left is greater than or equal to the value on the right. |
GT |
Returns the value TRUE if the value on the left is greater than the value on the right. |
LE |
Returns the value TRUE if the value on the left is less than or equal to the value on the right. |
LT |
Returns the value TRUE if the value on the left is less than the value on the right. |
AND |
Returns the value TRUE if both operands are true. |
OR |
Returns the value TRUE if either operand is true. |
NOT |
Returns the value TRUE if the operand is false. |
CONTAINS |
Contains the specified character strings. |
OMITS |
Omits the specified character strings. |
IS MISSING |
Returns the value TRUE if the field is missing. |
IS-NOT MISSING |
Returns the value TRUE if the field is not missing. |
Write a Relational Expression
value {EQ|NE} valuevalue {LE|LT} valuevalue {GE|GT} valuecharacter_value {CONTAINS|OMITS} character_value
where:
Write a Boolean Expression
(relational_expression) {AND|OR} (relational_expression) NOT (logical_expression)
where: