Hey ya'll
Does anybody know how to delete this statement instead of selecting it?
thx in advance for any helpCode:
strSql = "SELECT PartNO, Reg, WorkO FROM dOrder GROUP BY PartNO, Reg, WorkO HAVING COUNT(*) > 1"
//Patrick
Printable View
Hey ya'll
Does anybody know how to delete this statement instead of selecting it?
thx in advance for any helpCode:
strSql = "SELECT PartNO, Reg, WorkO FROM dOrder GROUP BY PartNO, Reg, WorkO HAVING COUNT(*) > 1"
//Patrick
I think you want to delete the items that occur in your query. If so I think this will cover you.
DELETE FROM dorder WHERE PartNO, Reg, WorkO IN
(SELECT PartNO, Reg, WorkO FROM dOrder GROUP BY PartNO, Reg, WorkO HAVING COUNT(*) > 1)
This will remove the whole record not just the three
items.
Yes, I think its the only way: a subquery.