Searching for Data

To query records in your current block or window, use the Find command or Query by Example.

The Find Command

The Find command displays a window in which you can specify search criteria. Depending on the block that you invoke Find from, one of two types of windows appears:

Generally, a find window appears for a multi-record block, while a list window appears for a single-record block.

Using the Find Command

Query by Example

To retrieve a group of records based on more sophisticated search criteria than Find allows, use Query by Example. Query by Example allows you to specify search criteria in any of the queryable fields in the current block. The search criteria can include specific values, phrases containing wildcard characters, or query operators.

If you do not need to retrieve the records, but only want to know how many records match your search criteria, perform a query count.

Using Query by Example

  1. From the View menu, choose Query by Example, then Enter.

    This action switches your window from data entry mode to Enter Query mode. Queryable fields are displayed in blue.

  2. Enter search criteria in the queryable fields. (Fields may be case-sensitive). To reuse criteria from your last search: From the View menu, choose Query by Example, then Show Last Criteria.

    Important: In Enter Query mode, all check boxes are initially in a null state. To use a check box as a search criterion, you must explicitly check or uncheck it.

  3. To perform the search: From the View menu, choose Query by Example, then Run.

  4. To exit Enter Query mode without searching: From the View menu, choose Query by Example, then Cancel.

To perform a query count

  1. Perform steps 1 and 2 from the previous task: "To use Query by Example".

  2. From the View menu, choose Query by Example, then Count Matching Records. The window's message line displays the number of matching records.

Query Operators

The following table shows the query operators for most fields, their meanings, and an example expression:

Query Operators

Operator Meaning Example Expression
= equals = 'Janet', = 107
!= is not != 'Bob', != 109
> greater than > 99.1, > '01-JAN-04'
>= at least >= 55
< less than < 1000.00
<= at most <= 100
#BETWEEN between two values #BETWEEN 1 AND 1000