WHERE Clause

The WHERE clause allows you to specify conditions that restrict the rows returned by your query only to those rows that meet the conditions.

To add a condition, do the following:

  1. Select the field whose value you want to restrict from the Fields panel.
  2. Choose the comparison operator. The following are available:
    Operator Meaning
    = Equal to
    <> Not equal to
    > Greater than
    < Less than
    >= Greater than or equal to
    <= Less than or equal to
    In Equal to any member of a set
    Between x And y Greater than or equal to x and less than or equal to y
    Like Pattern matching
    Is Null Tests for nulls
  3. Enter the corresponding right hand side of the comparison operator in the text field provided.
  4. Choose the logical operator to combine conditions (Only necessary if you have two or more conditions). The following logical operators are available: AND, OR, or None. The default is None.
  5. Click on the Apply button to add the condition to the list of conditions.
Repeat the above steps for each condition you want to add. To remove a condition from the list, choose the condition in the Clauses panel, and click the Delete button.

Click on OK to update the changes, or Cancel to cancel any changes.

Note that to avoid SQL syntax errors, the following general SQL rules apply to literals like numbers, text strings, dates, and time stamps that you want to enter in the text fields of the conditions:

The following table shows example of using comparison operators in conditions:
Expression Meaning
>234 Numbers greater than 234
<1200.45 Numbers less than 1200.45
>='James' All names from James through the end of the alphabet
In('New York','Chicago','Atlanta') Any city that is New York, Chicago or Atlanta
Between '2/2/93' And '12/1/93' Dates from 2-Feb-93 through 1-Dec-93
Like 'S%' Starts with S e.g. 'Samuel', 'Same', 'Smith'