How query mode works

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:

The sample DataWindow displays four columns of data titled Rep, Quarter, Product, and Units. The scrollable area shows seven rows of data. Beneath it, the total number of retrieved rows displays as Row count: 36.

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:

The sample DataWindow displays four columns titled Rep, Quarter, Product, and Units. The selection criterion Q 1 is entered in the Quarter column, and the criterion greater than 15 is displayed under Units. No other data is displayed. At the bottom, the Row count displays the number of rows retrieved: 36.

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:

The sample DataWindow displays four columns of data titled Rep, Quarter, Product, and Units. Three rows of retrieved data display under the column headings.

You can turn query mode back on, allow the user to revise the selection criteria, and retrieve again.