R
Rev
I have a table that is grouped by postal codes first 3 digits, and I
need to know how many customers are in each catagory of postal codes. I
could use count but there are multiple invoices for single customers,
and if I just use count it will count those multiple invoices as two
customers. Here is the syntax, what should it look like to be able to
count distinct customers. Thank you.
SELECT Left([Customer Table].[Zip/Postal Code],3) AS FSA, Sum([order
table].SubTotal) AS SumOfSubTotal, Avg([order table].SubTotal) AS
AvgOfSubTotal, Count([customer table].[Cust#]) AS [CountOfCust#]
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)
need to know how many customers are in each catagory of postal codes. I
could use count but there are multiple invoices for single customers,
and if I just use count it will count those multiple invoices as two
customers. Here is the syntax, what should it look like to be able to
count distinct customers. Thank you.
SELECT Left([Customer Table].[Zip/Postal Code],3) AS FSA, Sum([order
table].SubTotal) AS SumOfSubTotal, Avg([order table].SubTotal) AS
AvgOfSubTotal, Count([customer table].[Cust#]) AS [CountOfCust#]
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)