By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,365 Members | 3,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,365 IT Pros & Developers. It's quick & easy.

select count by group?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a

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.