Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: Records don't sort correctly when using count function

    I'm using Access 97 and I have a table with several text and numeric fields. I have a query that selects and sorts my records (alphabetically) by the information in 2 text fields. This query works correctly when I run it.

    I created a report based upon the query and I added the count function =count(*) to the header. When I preview the report, the correct count comes up but the records will not sort based upon my preset criteria (alphabetically).

    When I remove the count function from the report, it sorts correctly. When I add it back in, it won't sort correctly. I've tried putting the count function in the footer but I get similar results. I also pared the query down to a single alphabatized sort (by last name) but I get the same results.

    This is happening on 2 different reports. I have a third report that sorts by a date and everything works correctly.

    Please help.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Records don't sort correctly when using count function

    Originally posted by ojosparausted
    I'm using Access 97 and I have a table with several text and numeric fields. I have a query that selects and sorts my records (alphabetically) by the information in 2 text fields. This query works correctly when I run it.

    I created a report based upon the query and I added the count function =count(*) to the header. When I preview the report, the correct count comes up but the records will not sort based upon my preset criteria (alphabetically).

    When I remove the count function from the report, it sorts correctly. When I add it back in, it won't sort correctly. I've tried putting the count function in the footer but I get similar results. I also pared the query down to a single alphabatized sort (by last name) but I get the same results.

    This is happening on 2 different reports. I have a third report that sorts by a date and everything works correctly.

    Please help.
    What do you mean by "I added the count function =count(*) to the header"?

    Have you thought about specifying a sort order (grouping) in the report?

  3. #3
    Join Date
    Mar 2004
    Posts
    2

    Re: Records don't sort correctly when using count function

    Originally posted by M Owen
    What do you mean by "I added the count function =count(*) to the header"?

    Have you thought about specifying a sort order (grouping) in the report?


    Grouping doesn't solve the problem. The solution was to delete the sort function from the underlying query and to utilize the sort function in the report.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •