• Counting Criteria in Report (Access 2000/SR1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Counting Criteria in Report (Access 2000/SR1)

    Author
    Topic
    #1770061

    I am trying to count groups of test score data in a report. I have four ranges of data I want counted. Numbers from 0-25, 26-50, 51-75, 76-99. I have a test year field I am grouping on. I have tried using Greater than in various count functions in the un-bound text field. The latest I’ve used is: =IIf([Sat9English]>75<100,Count([Sat9English]),0) for the last range 76-100. I cant' get it to work. Any help would be great.

    Thanks
    Carleton W

    Viewing 0 reply threads
    Author
    Replies
    • #1785788

      Use two queries.

      In the first query create an expression along the lines of Abs([Sat9English]>75 and [Sat9English]<100). That will give you a 1 or zero value for each record. Create a similar expression for each grouping you wanted to count.

      Then create a second query based on the first and make the second one a group by query. Now you can use the Sum aggregate function to total each expression, and that will give you the count.

      • #1785789

        Or, check out my new favorite hidden function: Partition(). You can use it to group your scores into ranges that you define, then count the number of occurences in those ranges. It’s a great function, check it out in Help.

      • #1785797

        Thanks Charlotte it worked perfectly. It was so simple it was brilliant….

        Carleton

    Viewing 0 reply threads
    Reply To: Counting Criteria in Report (Access 2000/SR1)

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

    Your information: