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

Count distinct occurences

P: n/a
I have a query that provides detail for sales transactions meeting certain
criteria (date, purchase type, etc.) I am creating a report based on that
query, and I want to add a summary section. I want to add some counts, such
as the number of unique customers that purchased. I know can do this by
running a new query to group by customerID, then doing another query against
that to count the records, but there has to be a better way. Can I get what
I need without a subquery? (I'm using AccessXP on a 2000 format database.)

Thanks,

--
Steve Heath
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Steve
You can use report's groups. It depends, of course, how many summaries
you want to do, but in case of unique customers:
- group your report by customer
- in the group header (might be invisible) insert a text box =1
running sum over all (might be invisible, if the header is visible)
- in the report footer insert a text box=[name of text box in the
customer header]
When one needs to calculate simple summaries, running sum is good.
Atherwise, yes, subreport based on its own query.
Hope, it will help.
Galina

"Steve Heath" <st***************@sbcglobal.net> wrote in message news:<Bj*******************@newssvr33.news.prodigy .com>...
I have a query that provides detail for sales transactions meeting certain
criteria (date, purchase type, etc.) I am creating a report based on that
query, and I want to add a summary section. I want to add some counts, such
as the number of unique customers that purchased. I know can do this by
running a new query to group by customerID, then doing another query against
that to count the records, but there has to be a better way. Can I get what
I need without a subquery? (I'm using AccessXP on a 2000 format database.)

Thanks,

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.