Creating a Where Clause Using ANY or ALL

*  To create a Where clause using the ANY or ALL comparison modifiers:

  1. Select the data for the master query using the SQR Production Reporting Studio Query Builder.

  2. When you get to the Query Builder - Fields page, click Where; then, click Add Clause.

  3. Proceed through the pages in the Where Clause Wizard(see Where Clause Wizard. When you get to the Qualifier page, select a comparison operator.

    When you choose a comparison operator, you can modify it with the ANY or ALL comparison modifiers. Comparison modifiers are mutually exclusive – you can select ANY or ALL, or NONE, but not all three. When you choose ANY or ALL, the right side of the Where clause must be a subquery, and the Query Builder to create the subquery is displayed.

    For examples of creating a Where clause without a comparison modifier (you select None under Comparison Modifiers), see Creating Where Clauses to Evaluate Database Columns or Expressions.

  4. Create the subquery on the pages of the Query Builder.

  5. Return to the Where Clauses dialog box to view the Where clause that contains the subquery.