Comparison Operators
A comparison operator is a binary operator that takes two expressions as operands. Both expressions must be of the same type—numeric, string, or date. The following operators are recognized:
All comparisons are of equal precedence. When comparisons involving character strings are made, all blanks are ignored.
Conditional Expressions
A conditional expression has the form:
expr comp_op expr
The expr is an expression, and comp_op is a comparison operator.
An expression can be enclosed in parentheses without affecting its interpretation, as in the following examples:
(age < 50)
((salary * 12) >= 20000)
A conditional expression evaluates to true or false. It can contain partial match specification characters.
Pattern Matching with Wildcards
You can indicate partial matches of character string data in a conditional clause in an .if statement and in the where clause of a query by using special wildcard characters with the comparison operators. The character string data must be delimited by single quotes (except when used in a QUEL query).
Wildcards in an .If Clause
When used in a string within an .if condition, the special meaning of wildcard characters can be disabled by preceding them with a backslash (\) character. Report-Writer then interprets the wildcard character literally. Thus, \* refers to the asterisk character. When used outside of an .if condition, wildcard characters have no special meaning and are always interpreted literally.
You can use the following wildcard characters within a conditional clause in an .if statement for the purpose of comparing character string data:
Any of these special characters can be used alone or in combination to specify partial match criteria:
You cannot use blanks in bracketed expressions such as "[A‑J]*" or "[N-Z]???".
Wildcards in Queries
When a string appears within the where clause of a .query statement, the wildcard conventions must follow those of the database query language you are using to retrieve the data.
Last modified date: 08/28/2024