Where Clause Builder

Use the Where Clause Builder to add custom Where clauses to your query. Custom Where clauses allow you to hand code the SQL used in the Where clause. When you hand code SQL, you can enter advanced SQL features such as unions and intersects. Keep in mind that when you create a custom Where clause (as opposed to using the wizard in SQR Production Reporting Studio), you must be familiar with SQL, and you have more responsibility to maintain the clause.

*  To add a custom Where clause to your query:

  1. Enter the expression in the Clause field at the top of the dialog box. To enter an expression, use one of the following options:

    • Drag a function onto a column in the left pane.

    • Drag a function or column into the Clause field.

    • Double-click a function or column to enter it into the Clause field.

    • Type in the expression.

      To delete a Where Clause from the Clause field, click Clear.

      The types of functions (see Function Examples) and operators (see Operator Examples) that you can use in your Where clause appear under the Operations pane on the right-hand side of the dialog box (for example, comparison operators, logical operators, and range operators). To view the available options for each type of operation, click on the plus sign (+) next to the operation, or double-click the operation. The options that appear depend on your database.

  2. Click Validate to validate the Where clause before you insert it into your query.

    If the Where clause is valid, the question mark that appears on the Validate button changes to a check mark. If the Where clause is not valid, the question mark changes to an "X."

    Clicking Validate is optional. SQR Production Reporting Studio automatically validates the Where clause when you click Insert. Click Validate to ensure that you entered a valid Where clause before you insert it into your query.

  3. Click Insert to add the Where clause to your query.

    The Where Clause Builder remains open for additional entries. To add an additional Where clause, click Clear. If you are modifying a Where clause, Insert changes to Update.

  4. Click Close to close the Where Clause Builder.

    Note:

    SQR Production Reporting Studio enables Show Values when you click on a text or numeric column in the Tables and Columns pane. Click Show Values to display the values contained in the selected column. You can then use these values in your Where clause. To limit a report to customers in Utah, for example, you would click Show Values, select UT, and enter it into a Where clause such as CUSTOMER.STATE=’UT’.

Related Topics

Where Clauses

Adding Conditions to the Data (Creating Where Clauses)

Where Clause Wizard