Relational Operator Reference

The following reference describes the relational operators that can be combined to form a numeric field constraint.

The following table describes each operator that will be used to compare a value in a field with the range of valid values for that field. These must be used in conjunction with number values: for instance, to specify that the value must be greater than 1000, the constraint would be written as ">1000".

Name Symbol Description
Less Than < A valid value is less than the specified number.
Greater Than > A valid value is greater than the specified number.
Less Than or Equal To <= A valid value is less than or equal to the specified number.
Greater Than or Equal To >= A valid value is greater than or equal to the specified number.
Equal To = A valid value is equal to the specified number.
Not Equal To <> A valid value does not equal the specified number.

Boolean Logic Operators

The following table describes the Boolean operators that can be used to combine relational operators. Either the name or the symbol can be used; names are not case sensitive.  For example, to specify that a value must be between 1000 and 9999, the constraint could be written either as ">=1000 AND <=9999" or as ">=1000 & <=9999".

Name Symbol Description
AND & Both constraints must be met for the value to be valid.
OR | At least one constraint must be met for the value to be valid.
NOT ! The constraint must not be met for the value to be valid.

Order of Precedence

A numeric constraint can be created with more than one Boolean operator. In that case, the string will be analyzed in the following order: NOT will be applied first, followed by AND, followed by OR. Parentheses will be used for grouping.

Examples

The following examples demonstrate the use of the various relational and Boolean operators.

Desired Constraint Numeric Constraint String
A valid value must be greater than four. >4
A valid value must not be greater than 999. !>999
A valid value must be between 1 and 10, not including 1 and 10. 1 < & < 10
A valid value must be either between 100 and 200 or between 500 and 900, including 100, 200, 500 and 900. (>=100 & <=200) | (>=500 & <=900)