Hello,
I have a button on a form that deletes duplicate records. The backend was switched to Oracle and the query is now taking a very long time. I was wondering if there would be a more efficient way to write this.
I have tried putting the SQL in a query and running it, and it is just as slow.
Thanks.
I have a button on a form that deletes duplicate records. The backend was switched to Oracle and the query is now taking a very long time. I was wondering if there would be a more efficient way to write this.
Code:
Set qd = db.CreateQueryDef("", "DELETE * FROM [tblCompletionReport] WHERE ID NOT IN " & _
"(SELECT First([tblCompletionReport].ID) AS IDField FROM [tblCompletionReport] GROUP BY " & _
"[tblCompletionReport].TSO, [tblCompletionReport].TSR, [tblCompletionReport].CCSD, " & _
"[tblCompletionReport].[ABBREVCCSD], [tblCompletionReport].[ServiceType], " & _
"[tblCompletionReport].[CompletionDate], [tblCompletionReport].[DateTimeGroup])")
qd.Execute
qd.Close
Thanks.