Hi An,
Maybe I can walk you through it.
Create a regular query. The one as stated below:
DELETE T_Gr06.[NInq], T_Gr06.[HaveAll], *
FROM T_Gr06
WHERE (((T_Gr06.[NInq]) <Is duplicate> ) AND ((T_Gr06.[HaveAll]) Is Null));
Choose new query, don't choose a table click close in the dialog. In the
left corner of the Query you see a button which says "SQL". Click on that and
paste the code in the screen. Now choose "Design" - triangle button. You
should now see your query in the regular way. Now click the button Totals in
the menubar (button with the E).
Now in the querygrid look at the fields. You should see a group by option.
When clicked you'll see a combobox where you can choose count.
In the criteria field of the field [T_Gr06.[HaveAll] place Null.
This will delete all duplicates with a null value. Remember you have to make
a slight adjustment because when you don't supply a count > 1 the records
with one record will also be deleted.
hth
--
Maurice Ausum
an said:
Thank you for your reply.
I don't understand how to do this.
Thanks more one time.
an
Maurice said:
Hi An,
I think you are best of when you create a totals query (the totals button in
the querymenu). Reading your post I guess there can be more duplicates than
one. So place all the fields you've described in your query. Create totals by
Count and place the remaining criteria (null).
Be aware that you test this one out on a copy of the db and not directly in
a production enviroment! Removed records can't be recovered as you know!
hth
--
Maurice Ausum
:
H!
I would like a query to delete duplicates records only where the field "x"
is null.
Ex:
DELETE T_Gr06.[NInq], T_Gr06.[HaveAll], *
FROM T_Gr06
WHERE (((T_Gr06.[NInq]) <Is duplicate> ) AND ((T_Gr06.[HaveAll]) Is Null));
Thanks in advance.
an