Help with query

  • Thread starter Thread starter Subs
  • Start date Start date
S

Subs

I have a query

Data in column A Data in column B

John xcd
Fred bys
Jim bys
Jim bys

When I do a group by I get

John xcd
Fred bys
Jim bys


If i want to filter on Jim and count the number in Column B
How do I get a query to give me one line that gives me

Jim 2

Thanks for any help

Subs
 
Subs said:
I have a query

Data in column A Data in column B

John xcd
Fred bys
Jim bys
Jim bys

When I do a group by I get

John xcd
Fred bys
Jim bys


If i want to filter on Jim and count the number in Column B
How do I get a query to give me one line that gives me

Jim 2

Thanks for any help

Subs

Turn your select query into a totals query, With Jim as the criteria,
and a count on column B

SELECT ColumnA, Count(ColumnB) AS CountOfColumnB
FROM tblYourTable
GROUP BY ColumnA
HAVING (ColumnA="Jim");
 

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

Back
Top