S
shadowsong
I need to a query to return all records where the serial number in the
DATA.SN field appears more than once in the table DATA.
Doing a count() on that field and then grouping only returns one
record with a duplicate value, not every record with with a duplicate.
I assume it's due to the grouping, but count() is the only way I know
to find dupes and as far as I know count() has to be used with GROUP
BY.
Any ideas? Here's what I have at the moment:
SELECT data.DLRNAME, data.DLRNUM, data.SALESNAME, data.CUSTNAME,
data.ADDR1, data.ADDR2, data.CITY, data.STATE, data.ZIP, data.PHONE,
data.EMAIL, data.SOLD, data.MODEL, data.UPC, data.SN, data.ENTERED,
Count([data].[SN]) AS Count
FROM data
group by data.DLRNAME, data.DLRNUM, data.SALESNAME, data.CUSTNAME,
data.ADDR1, data.ADDR2, data.CITY, data.STATE, data.ZIP, data.PHONE,
data.EMAIL, data.SOLD, data.MODEL, data.UPC, data.SN, data.ENTERED
having Count([data].[SN])>1;
DATA.SN field appears more than once in the table DATA.
Doing a count() on that field and then grouping only returns one
record with a duplicate value, not every record with with a duplicate.
I assume it's due to the grouping, but count() is the only way I know
to find dupes and as far as I know count() has to be used with GROUP
BY.
Any ideas? Here's what I have at the moment:
SELECT data.DLRNAME, data.DLRNUM, data.SALESNAME, data.CUSTNAME,
data.ADDR1, data.ADDR2, data.CITY, data.STATE, data.ZIP, data.PHONE,
data.EMAIL, data.SOLD, data.MODEL, data.UPC, data.SN, data.ENTERED,
Count([data].[SN]) AS Count
FROM data
group by data.DLRNAME, data.DLRNUM, data.SALESNAME, data.CUSTNAME,
data.ADDR1, data.ADDR2, data.CITY, data.STATE, data.ZIP, data.PHONE,
data.EMAIL, data.SOLD, data.MODEL, data.UPC, data.SN, data.ENTERED
having Count([data].[SN])>1;