sum a count column in query

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
 
K

KARL DEWEY

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.
 
K

KARL DEWEY

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];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top