Unique values across multiple columns

Ody

Board Regular
Joined
Oct 14, 2010
Messages
215
Hi all,

Long time poster in the excel forum, infrequent poster in this forum because I rarely have a need to use Access.

Any way, I have a data set I can't quite manipulate in excel (2003) the way I want to. When I pull the info into Access I can pull distinct records from my customer data (SELECT DISTINCT data.Account FROM data)and distinct records from my acct data (SELECT DISTINCT data.CUSTOMER_NAME FROM data).

What I'm having a hard time doing is querying the count of unique customers that occur on each unique account number.

Any thoughts? I haven't used Access in a while and I'm a little rusty.

Thanks for any help!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Do you mean like this?
Code:
SELECT DISTINCT data.Account, data.CUSTOMER_NAME
FROM data;
 
Upvote 0
Thanks for the reply Joe4,

I tried that combination but it didn't provide me with an accurate answer.

From what research (i.e. googling) I've done it doesn't appear that access supports the Count(Distinct) aggregate so I'm not sure how to write a query that will give me the unique customers per unique account.

Make sense?
 
Upvote 0
If I understand what you are looking for correctly, I think you can correct this in two steps.

1. Create a DISTINCT select query to weed out your duplicates.

2. Create a second query, based on the first, and make this an Aggregate (Totals) queries that Groups By Customers and Counts the accounts.
 
Upvote 0

Forum statistics

Threads
1,224,565
Messages
6,179,549
Members
452,927
Latest member
rows and columns

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