Unique Customers with Duplicate Order Numbers

ashley25

Registered User.
Local time
Today, 20:45
Joined
Feb 17, 2013
Messages
46
The below code works fine in SQL server to identify customers with duplicate order numbers, however, I want to use it in access, but realised count(distinct) is not available there. Can someone help amend?


SELECT o.*
FROM (SELECT OrdNum, COUNT(DISTINCT CustId)
FROM OUTPUT
GROUP BY OrdNum
HAVING COUNT(DISTINCT CustId) > 1
) as oc INNER JOIN
OUTPUT as o
on oc.OrdNum = o.OrdNum
 

Users who are viewing this thread

Back
Top Bottom