Progress
Results User’s Guide
for Windows
Creating Filters
When you create a query, Results retrieves all the records in the tables you select. However, sometimes you might want to retrieve only a subset of these records. For example, you might want to refine the selection criteria for a query that retrieves customer invoices to retrieve only those invoices for customers in Massachusetts. You might further refine the query to retrieve only those invoices for customers in Massachusetts who have not paid for their merchandise.
To do this, you use a filter to create a set of instructions, called a WHERE clause, to instruct the query to retrieve only those records where the State field equals Massachusetts and the Balance field is greater than 0. In this example, the WHERE clause is written as follows:
In this example, State and Balance are fields; MA is compared to State using the equality operator (=); 0 is compared to Balance using the greater than operator (>); the logical operator AND bonds the two sections of the clause, called expressions, together. See "Comparison Operators," for a description of the available comparison operators.
Results makes creating a WHERE clause easy. Just select the elements you want to include in the clause and Results generates and formats the clause for you. If, however, you prefer to write and format clauses yourself, Results lets you create WHERE clauses manually.
Results provides you with two similar techniques for generating WHERE clauses:
Data Selection
Lets you generate a WHERE clause either manually or by selecting fields and operators and allows Results to format the WHERE clause for you. The WHERE clause can be based on any field from within any table in the query, whether or not the field is a display field. Data Selection also gives you the opportunity to set the selection criteria at run time. Available for all views.
Query by Example
Uses a blank form to help you generate a WHERE clause based on one or more display fields. Available only in Form view.
The following sections describe how to use these techniques.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |