How do I change Count to No Duplicates in Queries?

M

Me Again

Hi, I actually asked this question already, but I cannot find the
answer or the question for the life of me so I am going to ask it
again. I need to find the Number of customers that a company has based
on the invoices. I can't just Count normally because it will count a
customer with 2 purchases as 2 customers. How do I set this up to only
count the Sold to Customer # once? I'm guessing I have to change it in
SQL. Here is the current syntax. What should it look like? Thanks so
much.

SELECT Left([customer table].[Zip/Postal Code],3) AS FSA, Sum([order
table].SubTotal) AS [Total Sales], Avg([order table].SubTotal) AS
[Average Sale], Count([order table].[Sold to Customer]) AS [CountOfSold
to Customer]
FROM [customer table] INNER JOIN [order table] ON [customer
table].[Cust#] = [order table].[Sold to Customer]
GROUP BY Left([customer table].[Zip/Postal Code],3);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top