Count Field Values in Tables

lucour

Registered User.
Local time
Today, 09:26
Joined
Mar 7, 2001
Messages
60
Hi,

This is probably somewhat easy. I have an Access database that is being used for visitors to sign in and out of our Data Center. The table is called tblCompRoomLog. In it is a field called InName. This lists the names of the visitors that have visited the Data Center. I want to query this field, group all like names together, and then count them. The purpose of this is to show how many times a person has visited. So if there are 5 different record entries for "Bob Smith", I want to able to group this and then count how many times he has visited. From this, I want to create a status report. It will look like:

Bob Smith has visited the Data Centre 5 times this month
Ken Campbell has visited the Data Centre 23 times this month
Joe MacNeil visited the Data Centre 41 times this month

Thanks !
 
If your report will be just that simple, it might be easiest for you to use a simple DCount function in a text control on your report. You can use a formula like this:
=DCount("InName","tblCompRoomLog","[InName]='Bob Smith'"

A step up in complexity, but better in design, to create a totals query on the tblCompRoomLog table where you group by InName and create a calculated count field. Then save the query, and base your report on it.
 
Thanks very much dcx693 ! I used your second suggestion of creating a Totals query whereby I used a Group By on the name field and a Count in a calculated field. It worked perfectly and is exactly what I need.

Thanks again !
 

Users who are viewing this thread

Back
Top Bottom