Totals Query

  • Thread starter Thread starter Steve S
  • Start date Start date
S

Steve S

Hi:
The results of my totals query are to be used alongside a delete query to
delete duplicates. The problem I'm having is that the totals query yields a
recordset that is read only, therefore the delete query can't delete the
duplicates because of the read only attribute. How can I remove the read
only attribute from the totals query?
Thank you,
Steve S
 
You can't remove the read only attribute form a totals query. You might be able
to use the totals query in a where clause. For Instance, the following sample
sql should work, ALTHOUGH it is likely to be slow since NOT IN is slow.

DELETE DistinctRow TableA.*
FROM TableA
WHERE TableA.PrimaryKey NOT IN
(SELECT MAX(PrimaryKey)
FROM SomeTable
GROUP BY SomeFieldA, SomeFieldB)
 
Back
Top