sum a count column in query

  • Thread starter Thread starter Glenn
  • Start date Start date
G

Glenn

Hi,

I have the following fields (Acorn Catergory, CL Code).
I have a query that will group by Acorn Catergory then group by CL Code and
then count by CL Code.

This result shows me under each Acorn Catergory which CL Codes are there and
how many records that CL Code has entered for that Acorn Catergory. What I
want is to total the count of CL code under each catergory.

Please can you help
 
Drop out the display for CL Code.

Are do you want both counts? For that you will either need a separate query
or DCount function.
 
Try this --
SELECT TableA.[Acorn Catergory], Count(TableA_1.[CL Code]) AS CountOfCLCode,
[TableA].[CL Code], Count(TableA.[CL Code]) AS CountOfCLcode1
FROM TableA INNER JOIN TableA AS TableA_1 ON TableA.[Acorn Catergory]=
TableA_1.[Acorn Catergory]
GROUP BY TableA.[Acorn Catergory], [TableA].[CL Code];
 
Back
Top