Further refining search criteria using SQL operators
While searching for items, Pro! allows you to modify the AND and OR SQL operators, and insert the NOT operator, in order to tailor the search exactly to your needs:
-
The AND operator displays a record if both the first condition and the second condition are true.
-
The OR operator displays a record if either the first condition or the second condition is true.
-
The NOT operator displays a record if the condition is false.
To further refine search criteria using SQL operators:
1. After executing an item search by entering search criteria, click the SQL Operators button. The SQL Operators window will appear:
In the example above, the user's item search has created a series of three SQL operator expressions that equate to the following search string:
Answer Choice contains "d" AND (Battery Status = "Pending") AND (Reference Citation = "Accounting Monthly" OR Reference Citation = "FASB Guide)
Suppose, however, that the user wants the search string to equate to the following:
Answer Choice contains "d" OR (NOT Battery Status = "Pending") OR (Reference Citation = "Accounting Monthly") OR (Reference Citation = "FASB Guide)
To do this, the user would need to change AND and OR expressions, and insert parentheses ( ) throughout. To do this, the user would follow Steps 2 through 5, below:
2. Click in the AND/OR cell for the desired expression, and click either the AND button or the OR button. In the example below, the user has:
A. Clicked the AND/OR cell of Battery Status.
B. Clicked the OR button.
C. This has changed the AND/OR cell to OR.
3. Click in the Opening cell of the desired expression, and click the +NOT button, then click the +( button. In the example below, the user has:
A. Clicked the Opening cell of Battery Status.
B. Clicked the +( button.
C. Clicked the +NOT button.
D. This has changed the Opening cell to (NOT.
4. The user would continue as above, inserting the expressions AND, OR, and NOT, and parentheses ( ) in order to complete the search string. Note that the –NOT button and the –( and –) buttons are used to remove the NOT expression and the parentheses.
5. When complete, the user's desired expression:
Answer Choice contains "d" OR (NOT Battery Status = "Pending") OR (Reference Citation = "Accounting Monthly") OR (Reference Citation = "FASB Guide)
would look like this: