> STEP 1: BACKUP your data before attempting the following.
> STEP 2: BACKUP your data before attempting the following.
[quoted text clipped - 33 lines]
> >
> > - Thanks for your help
I realy don't understand why that query statement did not work.
Did you open a query in SQL view and paste the statement in there. The
posted SQL was not criteria for a field.
DELETE FROM TEST_MBS2
WHERE ID1 Not In
(SELECT Min(ID1) AS MinOfID1
FROM TEST_MBS2 AS Dupe
GROUP BY ID, [Last Name], [First Name], Amount, Used)
That query should do what you asked.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
> I have numerous records with duplicate 'ID' numbers and different 'ID1'
> numbers that need to be kept ('AMOUNT' will be different or 'USED' will be
> different and, so, not identical). I want to ONLY delete those records with
> different ID1's where ALL OTHER FIELDS are identical.
FirstVette52 - 14 May 2008 16:11 GMT
Thank You John! It worked! I'm not sure what went wrong last night, but
wien I came in this AM and did it again, it worked beautifully. Nice piece of
code.
ACCESS changed your code upon execution as follows:
DELETE *
FROM TEST_MBS
WHERE ID1 Not In
(SELECT Min(ID1) AS MinOfID1
FROM TEST_MBS AS Dupe
GROUP BY ID, [Last Name], [First Name], Amount, Used);
The only thing I did different was to add the ';' at the end.
Thanks again!

Signature
FirstVette52
> I realy don't understand why that query statement did not work.
>
[quoted text clipped - 20 lines]
> > different and, so, not identical). I want to ONLY delete those records with
> > different ID1's where ALL OTHER FIELDS are identical.