Count Records By Emp

G

Guest

I need to have a query that counts the records grouped by Emp ID, like
12345 1
12345 2
12345 3
12346 1
12346 2

I have tried a number of queries to do this, but all I get is an aggregated
count or errors.
I don't want to code this one, I just need to use a straight query(s)
 
G

Guest

Just use a totals query like this --
SELECT YourTableName.[Emp ID], Count(YourTableName.[Emp ID]) AS CountOfEmp
FROM YourTableName
GROUP BY YourTableName.[Emp I;
 
J

John W. Vinson

I need to have a query that counts the records grouped by Emp ID, like
12345 1
12345 2
12345 3
12346 1
12346 2

I have tried a number of queries to do this, but all I get is an aggregated
count or errors.
I don't want to code this one, I just need to use a straight query(s)

Do you want a *count* - or a running incrementing number? Are you displaying
other fields? Do you have some other field in the table (maybe a primary key)
that you can count on being strictly ascending?

John W. Vinson [MVP]
 

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

Similar Threads

Combining Duplicates in Select qry 3
combining records 1
Add a row to a query result. 4
parameter query 13
Rearranging data 3
Joining two count results 4
Multiple Queries 5
Duplicate Count 2

Top