SQL Genie Filter Tab

Description

The Filter tab of the SQL Genie defines the expressions that limit the records that your SQL SELECT statement will return.

images/SQR_SQL_Genie_Filter_tab.gif

Any time that the Execute Query button ('lightning' icon) is enabled, you may click it to see a sample of the records that the query will return. At any time you may click the History button to see a list of SQL statements previously created in this session in the SQL History Dialog.

Selecting the Records to Appear in the Report 

The WHERE clause of a SQL SELECT statement filters the records that will be returned. as the illustration above shows, a WHERE clause may have multiple parts, each of which evaluates to a logical value, separated by AND or OR keywords. In the example above, only records where Customers.Country <> 'USA' and Orders.OrderDate < {1998-01-01} will be returned.

There are 2 methods of generating a WHERE clause.

  • Directly enter it into the SQL text box.

  • Use the genie controls at the top of the dialog to construct the SQL statement.

Using the Genie Controls

  1. To the right of the Field\Expression column click the 'up arrow' to display the Select Column or Expression dialog.

    images/SQL_Expression_Button.gif
  2. Create an expression that references one or more columns and click OK.

  3. Select an entry from the Operator list.

  4. Depending on the operator you selected, To the right of the Value\Expression column click the 'up arrow' to display the Specify a Value or Expression dialog.

  5. Optionally, place matching parentheses to the left and right sides of the expression.

  6. Optionally, select the Not checkbox to invert the logic of the expression.

  7. Optionally, click the '+' to add another part to the WHERE clause.

  8. Select "And" or "Or" from the list box at the left side of the second and subsequent parts of a multi-part expression.

  9. Optionally, click '-' to remove a part of the WHERE clause.

See Also