Selecting Fields

Use the Query Builder - Fields page to select the database columns that will make up the fields in your query. You can design a query to retrieve all the columns associated with each table, or you can select specific columns to retrieve.

*  To select the database columns that will make up the query fields:

  1. Select the desired database columns.

    • Drag a column from Tables and Columns to Query Fields.

    • Select a column and click the right-arrow.

    • Double-click a column.

    To select all of the columns in a table, select the table using one of the methods described above. To delete a column from Query Fields, click the column and click the left-arrow. (To select more than one column to delete, hold down the [Ctrl] key and click the desired columns.)

  2. Use Up Arrow/Down Arrow buttons to define database column order in the default report layout.

    The default layout is the layout that initially appear when you format a report in the Layout window. The order in which the database columns appear on the Fields page is the order in which the columns will appear in the default report layout. You can change the column order as you format your report in the layout if desired.

    Note:

    Subqueries must have at least one database column to work. (An expression cannot substitute for a database column.)

    FieldDescription

    Distinct Values

    Eliminates duplicate query rows; only rows that are distinctly different are returned. Distinct Values Example

    Limit number of rows to

    Limits the number of query rows. Limiting the Number of Query Rows Example

    New

    Select Expression to access the Expression Builder (see Accessing the Expression Builder ), where you can add expressions to the query, or select Subquery to define a subquery (see Understanding Subqueries). To modify an existing expression or subquery, select the expression or subquery and click Edit or double-click the expression or subquery.

    Group By

    Accesses the Group By dialog box, where you can manually configure the grouping (see Grouping Columns).

    Having

    Accesses the Having Clauses dialog box (see Creating Having Clauses), where you can create Having Clauses for the query. SQR Production Reporting Studio enables the Having button only if you create an Expression that uses an Aggregate Function.

    SQL

    Displays the SQL code used to generate the query.

    You can copy the SQL code from the Show SQL window to the SQL editor provided by your database client software. Advanced users may find this useful for debugging queries.

    From

    Accesses the Custom From Clause Builder where you can create custom From clauses to use in your query (see Creating Custom From Clauses).

    Where

    Accesses the Where Clauses dialog box where you can enter query conditions and customize the rows of data retrieved.

    Order By

    Accesses the Order By dialog box where you can sort by one or more database columns (see Sorting Data).