469,648 Members | 1,602 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

select count by group?

Is it possible in access to select the total count of records for a
given group of records and show those all those counts in one report?
For example, I have a table of records that contain different customers
with different service requests. I would like to build a report that
shows the quantity of service requests for each customer and then maybe
later, by type of service request for each customer. Fields are
CustomerName, ServiceRequestDate, Type. I can use the query builder and
know a little SQL and I can make a report for each customer with the
count in it, but all I'm really interested in is the count for each
customer, hopefully on 1 report? Thanks for any help....

Nov 13 '05 #1
2 17935
wi*********@yahoo.com wrote:
Is it possible in access to select the total count of records for a
given group of records and show those all those counts in one report?
For example, I have a table of records that contain different customers
with different service requests. I would like to build a report that
shows the quantity of service requests for each customer and then maybe
later, by type of service request for each customer. Fields are
CustomerName, ServiceRequestDate, Type. I can use the query builder and
know a little SQL and I can make a report for each customer with the
count in it, but all I'm really interested in is the count for each
customer, hopefully on 1 report? Thanks for any help....


Try

SELECT CustomerName, Count(CustomerName)
FROM MyTable
GROUP BY CustomerName;

And maybe later

SELECT CustomerName, Type, Count(Type)
FROM MyTable
GROUP BY Type, CustomerName
ORDER BY CustomerName, Type;

--
Smartin
Nov 13 '05 #2

Smartin wrote:
wi*********@yahoo.com wrote:
Is it possible in access to select the total count of records for a
given group of records and show those all those counts in one report?
For example, I have a table of records that contain different customers
with different service requests. I would like to build a report that
shows the quantity of service requests for each customer and then maybe
later, by type of service request for each customer. Fields are
CustomerName, ServiceRequestDate, Type. I can use the query builder and
know a little SQL and I can make a report for each customer with the
count in it, but all I'm really interested in is the count for each
customer, hopefully on 1 report? Thanks for any help....


Try

SELECT CustomerName, Count(CustomerName)
FROM MyTable
GROUP BY CustomerName;

And maybe later

SELECT CustomerName, Type, Count(Type)
FROM MyTable
GROUP BY Type, CustomerName
ORDER BY CustomerName, Type;

--
Smartin


Thank-you for assisting me, I was on the right track but the
parenthisis "COUNT(What i want to count)" threw me. Again, thanks for
your help.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Joseph Santaniello | last post: by
22 posts views Thread by MP | last post: by
8 posts views Thread by Gilles Ganault | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.