Progress
Results User’s Guide
for Windows


Using Query by Example to Refine a Query

Query by Example is available in the Form view. Use Query by Example when you want to refine the selection criteria for the query by using one or more display fields in the form. If you already created a WHERE clause for the same table using Data Selection, Query by Example automatically deletes the WHERE clause and replaces it with the WHERE clause you create using Query by Example. Follow these steps to use Query by Example:

  1. Choose the Query by Example button at the bottom of the form. A blank form appears:
  2. You can use any of these fields to modify the selection criteria for the query.

  3. Go to the first field you want to use and type the selection criteria for the field.
  4. The selection criteria for a field consists of an operator and the value you want the operator to work on. For example, to retrieve all the unpaid invoices, type > 0 in the Balance field.

    You can use the following comparison operators: =, <>, <, >, <=, >=, Begins, Matches, and Contains. See "Comparison Operators," for a description of these operators. If you do not enter a comparison operator in the selection criteria, Query by Example automatically uses the equality operator.

    You do not have to place quotation marks (“”) around text strings unless the first word in the text string happens to be the name of a comparison operator. For example, to select all the records that pertain to customers in Massachusetts, type “MA” in the State field.

  5. If you want to further refine the selection criteria, enter the selection criteria for one or more additional fields. For example, to display unpaid invoices for the first 49 customers, type <= 49 in the Cust-Num field and > 0 in the Balance field:
  6. When you are finished defining the selection criteria, choose OK.
  7. Results saves the selection criteria as a WHERE clause and retrieves the matching records. Note that once you create a WHERE clause, Results maintains the WHERE clause until you change or delete it.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095