Need Unique Count

kmacd6951

Board Regular
Joined
Mar 3, 2004
Messages
58
I thought creating a query within a query was what I needed to do, but now I am not sure.

I run a query, entering a date range, based on multiple tables. I put the results into a Pivot Table view and move my data fields around to get a variety of totals.

For example:
Header: Team_Specialties
Column: is Customer Code
Data: is Count of Case ID's for each customer.
so:
Team_Specialties (EDI, APP, TECH)

ABC 5
GFR 3
JHU 2


I need to be able to then change and select only one of the 3 Team_Specialties (EDI, APP, TECH) at a time, and then get a count of Unique customer Codes. Right now the count I get is the # of cases for all those customers. (e.g 10, when I really want to see 3)

This is done in Excel using COUNTA function on the column of Customer Codes. How do I do this in Access?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try using a Totals query to group the results by type.
Then base a further query on the Totals query. You should be able to use COUNT the second time around, to give what you want.

An alternative is to build a query with no more than 2 or 3 fields, one of which is Team_Specialties. Once you have the data displayed, go into SQL view.
Change the first line from SELECT ... to SELECT DISTINCT ...
This will grab the first occurrence of each different record. A simple count on these will also give the result.

Denis
 
Upvote 0
Otherwise, use Group By on a field to test only a specific field in a record with Count().
 
Upvote 0

Forum statistics

Threads
1,221,639
Messages
6,160,998
Members
451,682
Latest member
ogoreo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top