Boolean Operators

Boolean AND and OR buttons are available to refine search criteria.

Operator

Meaning

AND

combines two or more criteria entered

OR

searches for either criteria entered

To use Boolean operators in a search:

  1. Enter the first component of the search criteria. The search criteria is displayed in the SQL window

  2. Click AND or OR button

  3. Enter the second search criteria

  4. Repeat for further criteria

  5. Click SEARCH

For example: Search for Title relating to ‘Merger Guidelines in the Trade Practices Act

  1. Select Title from the Where: pop-up list

  2. Select Like from comparison operator pop-up list to search for the title as a string

  3. Enter Trade Practices Act

  4. Click AND Boolean operator

  5. Enter Merger Guideline (the system automatically truncates the beginning and end of a string. In this case guideline and guidelines will be retrieved)

  6. The search string is displayed at the SQL window, connected by the AND operator

  7. Click SEARCH

Tip:

  • Use the ‘not like’ comparison operator is used to perform a Boolean NOT search.

 

For example: Search Title using the Boolean NOT operator

  1. Select Title from the Where: pop-up list

  2. Enter the first component

  3. Select Like from the comparison operator pop-up list

  4. Click AND

  5. Select Not Like from the comparison operator pop-up list

  6. Enter the second component

  7. Click SEARCH

FIRST has no order of precedence in relation to the Boolean operators AND and OR i.e. precedence is determined by the position in the search string.

A search string can be either typed into the SQL window on a Search screen in FIRST or constructed by selecting fields from the Where: pop-up list, comparison operators from the comparison operator pop-up list, entering search criteria in the data entry box and selecting Boolean Operators.

The constructed search string is read by the computer from left to right. However, the parsing engine, which calculates or valuates the search string, reads the SQL search string right to left. The effect of this is illustrated below:

For example, a search string:

‘A AND B AND C OR D’ will be calculated as (A AND (B AND (C OR (D))

In other words all records matching ‘C OR D’ will be retrieved first. Then all records from this initial set that also match ‘B’ will be retrieved. This second set will then be combined with all records matching ‘A’ to generate the final search result.

The Venn diagram below illustrates the final set of records retrieved.

FIRST2200000200.gif

If you enter parenthesis to enforce nested Boolean logic then the nested components are again calculated or valuates right to left.

For example, a search string:

((A AND B) AND (C OR D)) OR E

All records matching ‘E’ are retrieved first. Then records matching both ‘C OR D’ are added to the records matching ‘E’. ‘This set (C OR D) OR E’ is added to all records matching ‘A AND B’ to create a final search result.

The Venn diagram below illustrates the final set of records retrieved.

FIRST2200000201.gif