Previous Topic

Next Topic

Book Contents

Book Index

GUI Query Builder - Where Tab

Access this window from the Where tab of the Query Builder.

This window is used to specify the criteria for a query by building a WHERE statement. The Where statement sets the criteria that specify the rows to be returned by the query.

Where Statements

A Where statement consists of one or more Where clauses.

For instance, the following Where statement:

(name=’fred’ and state=’CA’) or (salary<10000 and name is null)

consists of 4 Where Clauses. These clauses are connected by ANDs and ORs; and indented within various levels of brackets.

Where Window

The top pane of the Where window has a grid displaying your Where clauses, and how they are connected

The bottom pane is a text box which shows you the entire Where statement.

Building Where Statements

You build your Where statement in two steps:

These two steps are described below.

Building Where Clauses

You do this by clicking on either

NEW and MOD will take you into the Where Clause window that makes it easy to build a Where Clause.

DEL deletes a Where Clause.

Specifying how the Where Clauses are Connected

Connect your Where clauses using the grid in the Where window. First, you must build some Where clauses, which will be displayed in the grid.

Displaying Where statements

As you build the Where statement, it is shown in the text box. If you have a very large or complex Where statement you might find it very useful to check Show Clauses as Numbers. This shows clause numbers in place of clause text.

For instance (name=’fred’ and state=’CA’) or (salary<10000 and name is null) will be shown as (1 and 2) or (3 and 4). This can make it easier to understand complex Where statements.

Disabling a Where Clause

You can disable a Where clause by checking the Disable check box.

The Where clause will be removed from the query, however can be easily added back in by de-selecting Disable.

Show What

When you have specified a Summary query, (by setting the Query Type in Options > Columns) an extra box in the Where window will allow you to specify both Where clauses and Having Clauses. The Show What option allows you to specify which of these statements to display in the text box.