Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2007

Tip: Looking for answers? Try searching our database.

Count Records By Emp

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
G - 30 Apr 2007 17:30 GMT
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)
Signature

Thank you in advance for your assistance. It is greatly appreciated.

KARL DEWEY - 30 Apr 2007 17:58 GMT
Just use a totals query like this --
SELECT YourTableName.[Emp ID], Count(YourTableName.[Emp ID]) AS CountOfEmp
FROM YourTableName
GROUP BY YourTableName.[Emp I;

Signature

KARL DEWEY
Build a little - Test a little

> I need to have a query that counts the records grouped by Emp ID, like
> 12345       1
[quoted text clipped - 6 lines]
> count or errors.
> I don't want to code this one, I just need to use a straight query(s)
John W. Vinson - 30 Apr 2007 18:59 GMT
>I need to have a query that counts the records grouped by Emp ID, like
>12345       1
[quoted text clipped - 6 lines]
>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]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.