Count Records By Emp

G

G

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

KARL DEWEY

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