• Sorting a count in a report (2000(SP3))

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Sorting a count in a report (2000(SP3))

    Author
    Topic
    #430558

    I have a report based on a totals query that has a count of various services used on a month by month basis.
    Eg January: Service A – 22; Service B -11; Service C – 9
    February: Service A – 12; Service B -45; Service C 6

    I want to be able to sort the services in each month from highest count to lowest
    I have a grouping level on Months and a grouping level on Count of Services
    I have set the count of services group to sort descending to no avail.

    It sorts fine in the query. I have tried using the Val function in the query as mentioned in other postings but get error messages (I suspect because I am using the Count function to count the services in the query). I also tried (not very hard) to fiddle with sorting in the group footer’s on format event.

    I am assuming the problem is that the numbers in the count are being interpreted as a string, but even so, they are not sorting at all as far as I can see.

    Thanks as always.

    Viewing 0 reply threads
    Author
    Replies
    • #1005764

      If you have a Totals query with Count as total option for one of the fields, this count is a number, not text.

      As far as I can see, the Sorting and Grouping window should contain two entries:
      – Month, with Sort Order set to Ascending, and Group Header and/or Group Footer set to Yes.
      – Count of Services, with Sort Order set to Descending, and Group Header and Group Footer set to No.

      There should be NO entry for Service itself in the Sorting and Grouping window.

      • #1005873

        It took a little fiddling, but I finally got it to work. Thanks for putting me on the right track. As I suspected, it was a question of asking the query the proper questions and not giving the report conflicting sort requests.

    Viewing 0 reply threads
    Reply To: Sorting a count in a report (2000(SP3))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: