- Joined
- Nov 17, 2008
- Messages
- 1
- Reaction score
- 0
Hi All,
I have the following query that I wish to run on an Access '03 db:
SELECT SUM(Charged_Amt) / COUNT(DISTINCT Cust_ID)
FROM Table08;
Charged_Amt and Cust_ID are columns in Table08. Basically I want the total spend divided by the number of distinct customers.
Since COUNT(DISTINCT column_name) is not recognised in Access I was hoping someone could suggest an alternative. I have tried using nested queries but my SQL is very basic and I keep getting errors.
Any help would be greatly appreciated,
Mitch
I have the following query that I wish to run on an Access '03 db:
SELECT SUM(Charged_Amt) / COUNT(DISTINCT Cust_ID)
FROM Table08;
Charged_Amt and Cust_ID are columns in Table08. Basically I want the total spend divided by the number of distinct customers.
Since COUNT(DISTINCT column_name) is not recognised in Access I was hoping someone could suggest an alternative. I have tried using nested queries but my SQL is very basic and I keep getting errors.
Any help would be greatly appreciated,
Mitch