Counting records

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Is there a way to count only one instance of a record? So
If I have the same ID 3 times in the same table I want a
count of one and a sum of 3.
Data looks like this;

Name Contact ID
John 35434
John 35434
John 35434
Mary 55555

Group by query

Name Contact ID SUM Contact
John 1 3
Mary 1 1

Thanks!
 
Does the ContactID uniquely determine the name?

If that the case, the second Column of your result is always 1, isn't it?

Perhaps your are not posting the full details ...
 
try

SELECT PersonName, Count(ContactID) AS CountOfContactID
FROM MyTableName
GROUP BY PersonName;

btw, i hope you don't have a field in your table called "Name". that's an
Access Reserved word, and will cause problems if you use it as a fieldname,
controlname, objectname, etc.

hth
 
Back
Top