Create queries based on multiple criteria using boolean operators and parenthetical groupings.
Open the Query Editor
- Click menu .
- In the tree view, select a database table.
- Click the New Query button.
- Enter a name for the query in New Query Name.
- Click Continue to open the Query Editor.
Construct a Single Parameter Query
- In the Query Editor, on the Query Builder tab, choose a field from the drop-down list in the Field cell.
- Choose an operator from the Operator cell drop-down list.
- Enter a value in the Value cell, or click the [...] button.
The [...] button returns a list of all values for the specified field from the database table, allowing you to select the value you want. After selecting a value, click OK.
- If you want to save the query in the current drawing for future use, click Store.
- Click Execute to execute the query and close the dialog box.
Construct a Multiple Parameter Query
- Enter the first parameter of your query as described above.
- Select the appropriate And or Or operator from the Logical field.
Clicking in the Logical field inserts an And operator. Clicking the cell again changes the value to Or.
- Enter additional query parameters on subsequent rows.
- Repeat step 2 for each additional parameter except the final query parameter.
- Apply parenthetical grouping, if appropriate.
Click the cell to the left of the Field cell that begins the phrase that you want to group. A single left parenthesis is inserted. Click the cell to the right of the Value cell that ends the phrase that you want to group. A single right parenthesis is inserted.
- If you want to save the query in the current drawing for future use, click Store.
- Click Execute to execute the query and close the dialog box.
Specify the Display of Fields for Query Results
- Construct your query as described above.
- Select the first field that you want to appear in the Fields in Table list.
- Above the Show Fields list, click Add.
- Repeat steps 2 and 3 to include additional fields.
Specify the Sort Order for Query Results
- Construct your query as described above.
- Select the first field that you want to sort on from the Show Fields list.
- Above the Sort By list, click Add.
By default, the selected field is sorted in ascending order. Click the Sort button to sort in descending order.
- Repeat steps 2 and 3 for any additional fields that you want to sort on.