Once the DataWindow is in query mode, users can specify selection criteria using query by example—just as you do when you use Quick Select to define a data source. When criteria have been defined, they are added to the WHERE clause of the SELECT statement the next time data is retrieved.
The following three figures show what happens when query mode is used. First, data is retrieved into the DataWindow. There are 36 rows in this example.
Figure 10-1: Example of data retrieved from a database table
Next, query mode is turned on. The retrieved data disappears and users are presented with empty rows where they can specify selection criteria. Here the user wants to retrieve rows where Quarter = Q1 and Units > 15.
Figure 10-2: Example of a DataWindow in Query mode
Next, Retrieve is called and query mode is turned off. The DataWindow control adds the criteria to the SELECT statement, retrieves the three rows that meet the criteria, and displays them to the user.
Figure 10-3: Example of a DataWindow with results from query
You can turn query mode back on, allow the user to revise the selection criteria, and retrieve again.