Building restriction rules |
Each restriction rule consists of one or more condition statements. Each condition statement must have:
An initial value to be compared; this value can be a data item, a user defined item, or a constant. See How to Include Items in a Restriction Rule.
A second value to be compared; this value can be a data item, a user defined item, or a constant.
Note: Constant values that represent non-numeric data (single characters and character strings, as well as dates and times) must be enclosed in single quotation marks.
If the restriction rule includes more than one condition statement, you must use a conjunction operator to specify whether either of two statements must be true (the OR operator) or both statements must be true (the AND operator).
Brackets are always optional if they enclose only a single condition statement or if all the conjunction operators (e.g., AND, OR) are the same. Examples of condition statements with a single comparison operator are:
A = B + 1
A = (B + 1)
In both examples, the value of A is equal to the value of B + 1.
In very complex restriction rules, several sets of brackets may be required to clarify the desired logical operations. For example:
A = B AND C = D OR E = F
Without brackets, the rule might be interpreted in either of the following ways:
Example 1. A = B, and either C = D or E = F
Example 2. both A = B and C = D, or E = F
In cases like this, use brackets to clarify the rule. Brackets applied to the above examples would look like this:
For example 1. (A = B) AND (C = D OR E = F)
For example 2. (A = B AND C = D) OR (E = F)