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

Count Unique Values in Report (Access)

newnewbie
P: 54
Hi,
Could somebody please help me with VBA code to count unique values in a Report?

Report is based on a query that has grouped values. Basically, I would like to use formula =COUNTUNIQUEVALUES([field_name]) in the report form. Is it possible?

Thank you!

Lena
May 13 '08 #1
Share this Question
Share on Google+
1 Reply


jeffstl
Expert 100+
P: 432
Hi,
Could somebody please help me with VBA code to count unique values in a Report?

Report is based on a query that has grouped values. Basically, I would like to use formula =COUNTUNIQUEVALUES([field_name]) in the report form. Is it possible?

Thank you!

Lena
I think this is what you might need

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT DISTINCT COUNT(column_name(s))
  3. FROM table_name
  4.  
Keep in mind this counts the number of ROWS returned from the query. It does not add anything. If you need a total sum of the values stored in the column you need to use SUM instead of COUNT
May 13 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.