Knowledge Base

# Equality and Relational Operators

Equality and relational operators are used as part of logical rules that perform a comparison and return either true or false. There are two equality and four relational operators that can be used in logical rules in the Rulestar system. These logical rules either perform numeric comparisons (using field and option values) or direct comparisons (using the option chosen in Radio, Select and Checkbox Fields). ### Equality operators

The equality operators:

• equals "="
• does not equal "!="

can be used to create a logical rule with the following fields:

The equality operators are used as follows:

1. (Number and Date/Time Fields) - Logical rules that contain a Number or Date/Time Field and either equality operator compare the field value (ie, the numeric value of the Number Field or date/time of a Date/Time Field) to the answer provided in the logic expression eg, [Age] = {18}.
2. (Radio, Select and Checkbox Fields) - Logical rules that contain a Radio, Select or Checkbox Field and an equality operator do not compare the option value to the answer. Rather, a logic expression containing a Radio, Select or Checkbox Field and an equality operator will look directly at the reference code of the option that is selected and compare it to the Reference Code of the Option that is designated as the answer within the logic expression. For example, [Practise area] = {Family Law} will perform a comparison by looking directly at the option selected (ie, the selected option's reference code) and will not consider any assigned option value.

### Relational operators

The relational operators:

• greater than ">"
• greater than or equal to ">="
• less than "<"
• less than or equal to "<="

can be used to create a logical rule with the fields as the equality operators (except for a Checkbox Field).

The relational operators are used as follows:

• (Number and Date/Time Fields) - Logical rules that contain a Number or Date/Time Field and a relational operator compare the Field value to the answer provided in the logic expression. For example, [Count] >= {5} and [Date of Birth] < {2010-08-02} will both perform comparisons between the field value and the answer value.
• (Radio, Select Fields) - Logical rules that contain a Radio or Select Field and a relational operator are not evaluated using option reference codes like an equality operator. Rather, the option value is used to perform a numeric comparison. Meaningful option values are therefore very important if you wish to perform a relational comparison on a Radio or Select Field. For example, [Practise area] > {Family Law} will perform a comparison using the selected option value and the option value assigned to the "Family Law" option.