locked
Count And Sort RRS feed

  • Question

  • User-1186309636 posted

    Hi,

    I have a table of records in an access database and need to count and group by separate columns.

    The table is called CASES and I need to count records from a certain date range then group them by person from a column called INDIVIDUAL THEN sort within that individual by CASETYPE and display the record cound for each separate individual  and case type.

    It's for reporting functionality and have no idea where to start with this. Any assistance would be very much appreciated. :-)

    Friday, April 8, 2011 6:05 AM

Answers

  • User761909039 posted

    Here is the SQL query you are looking for..

     

    SELECT INDIVIDUAL, CASETYPE,Count(*) 
    FROM CASES
    WHERE DateColumn BETWEEN @DateStart AND @DateEnd
    GROUP BY INDIVIDUAL, CASETYPE
    ORDER BY INDIVIDUAL ASC, CASETYPE ASC
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 8, 2011 7:08 AM

All replies

  • User761909039 posted

    Here is the SQL query you are looking for..

     

    SELECT INDIVIDUAL, CASETYPE,Count(*) 
    FROM CASES
    WHERE DateColumn BETWEEN @DateStart AND @DateEnd
    GROUP BY INDIVIDUAL, CASETYPE
    ORDER BY INDIVIDUAL ASC, CASETYPE ASC
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 8, 2011 7:08 AM
  • User-1186309636 posted

    Thanks heaps! Worked like a charm! :-)

    Friday, April 8, 2011 7:28 AM