Examples of advanced search bar statements


The statements in the following examples illustrate ways you can use the advanced search bar to build complex searches:

Request type

Request example

Description

Request created by someone other than the current user.

'Submitter' != $USER$

Uses the not equal to operator (!= ) to find instances where the value in the Submitter field is not equal to the user who is currently logged in.

Request created after 10:00 a.m. on the current day.

'Create date' > "10:00:00"

Uses the greater than operator (> ) to find requests where the value of the Create date field is greater than the current day at 10:00 a.m.


Request created for any problem that involves printing.

'Submitted Problem Type' LIKE "%print%"

Uses the LIKE operator to perform a pattern search that finds requests with the word print anywhere in the Submitted Problem Type field.

NOT ('Submitted Problem Type' LIKE "%print%")

Uses the LIKE operator to perform a pattern search that finds requests that do not contain the word print anywhere in the Submitted Problem Type field.

Request created with a status of released.

'Status  ' = "Released"

Finds all requests with a status of Released.

Notice the spaces after the word Status in the field specification. The spaces exist in the field label on the form being used.

If you use the Field List dialog box by selecting the Fields button on the advanced search bar, the spaces and single quotation marks are added automatically.

Request created to find empty character fields

'CharacterField' != "one" OR 'CharacterField' = $NULL$

Finds all character fields that do not have any data.

Important: A search statement that includes a not equal to operator (!= ) might return unexpected results because the advanced search bar complies with ANSI SQL standards. One of these standards distinguishes between fields that contain data and fields that have never contained data. 

For example, the following statement does not return requests where CharacterField is empty:

'CharacterField' != "one"

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*