To create a command object

  1. In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
  2. Log on to your data source if necessary.
  3. Under your data source, double-click the Add Command node.
  4. In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.

    For example:

    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
  5. Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.

    For more information about creating parameters, see To create a parameter for a command object.

  6. Click OK.

    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.