Simple Count Query

L

lc317

Hello, I recently got stuck with doing some minor maintenance on a small
Access 2003 DB, and could use a hand on writing a query. What I need to do is
make a "count" query, in which it will pull values from a column in a table,
and add them up. The column in question consists mostly of cells titled like:

07 TEST-A
07 TEST-A
07 TEST-A
07 TEST-A
07 TEST-A
08 TEST-B
09 TEST-C
09 TEST-C
09 TEST-C
TEST-D
TEST-D

However, some cells in the same column begin just with "TEST-C" (i.e. without
a leading "07", or "08") I need the query to generate a column that will do a
count of each "category" (i.e. "07 TEST-A", etc). What I envision the query
output to be (based on the examples above) would look something like this:

07 TEST-A = 5
08 TEST-B = 1
09 TEST-C = 3
TEST-D = 2

I hope I made sense, and would appreciate any pointers with this! Cheers!
 
J

James Walker

Try this:

SELECT Category, COUNT(Category) AS CountOfCategory
FROM (Table Name Here)

James
 
K

karl dewey

Try this --
SELECT [YourField], Count([YourField]) AS Field_Count
FROM YourTable
GROUP BY [YourField];
 
J

James Walker

Please "copy and paste" your query so I can see what you have.

James Walker
 

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