Add Count Field to Query

Adding count fields to your query allows you to display the number of occurrences of a specific field (either all records or unique values). For example, you can list the total count of records. When a Count field is added, the query results includes exactly one record with the indicated count value (multiple records are returned only if the Group By section is completed). If you want to add the values in a particular numeric field together, use Sum.

  1. From the Tools menu, select the Queries... option.

    The Queries form is displayed.

  2. Select the module and record area, and either create a new query, or modify an existing query.

    Information on creating or modifying a query is available in Create New Query and Modify Query.

  3. In the Query Designer form, Fields section, highlight the field name in the left box, then press .
  4. You are prompted to count all records, or distinct values.
  5. Press Yes to add a count of all records, and No to count only distinct values.
  6. When you count all records, every record is included in the count.

    When a distinct count is used, only distinct values are included. The distinct count will be equal to or less than the total count. The Count field is added.

  7. Complete the Group By section before saving the query.