Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2006, 08:28 AM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Count Distinct

Hey all,

I have a query pulling up many different claims and corresponding payments. My question is how to get a count of each different claim ID, not total number of claim ID's. For example:
Claim 1 $500
Claim 2 $600
Claim 1 $700

I want this count to be 2, not 3. 2 different claims (Claim 1 and Claim 2) not total claims. Thanks!

 
Old August 11th, 2006, 10:57 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Hi Jonas,

Use the access query builder, and specify that table. Then drop the Claim ID field down twice, click the grouping button on the top, and then ensure that the group by for the first is Group By, and the Second one is Count.

Hope that helps,

Mike

Mike
EchoVue.com
 
Old August 14th, 2006, 01:03 PM
Authorized User
 
Join Date: Jul 2006
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Mike,

Thanks for the reply, but that just gives me the total number of claims. what i need is the number of different claims names (IE claim-1, claim-2etc) even if theirs 100 different claims with the name "mike" it should only count it once.

Suggestions?





Similar Threads
Thread Thread Starter Forum Replies Last Post
count distinct values Chris Cash XSLT 3 June 8th, 2006 04:55 PM
count distinct nodes alexshiell XSLT 2 January 27th, 2005 11:19 AM
sql to return distinct count pbgurl Access VBA 2 October 29th, 2004 06:29 AM
COUNT ON SELECT DISTINCT stmt savoym SQL Language 7 August 28th, 2003 07:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.