Release 10.1A: OpenEdge Reporting:
Query/Results 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:

> `State` `= "MA" AND Balance > 0`

> 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 Appendix B, "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 a `WHERE clause` manually.

> Results provides you with two similar techniques to generate a `WHERE clause`:

> - Data selection

> - Query by example

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