Hi All,
I have a problem with duplicates in my database that I need to remove, but the problem is that some of the duplicates are OK and need to be left alone. Let me clarify....my database imports data that uses a "key" value so that every few days an individual key can get reused. Those are OK. The ones that need to be deleted are when two duplicate keys are used on the same day.
The duplicate query I build finds all duplicates, but what it really needs to do is find duplicates that occur on the day day. If anybody could modify this to do what I need, I would greatly appreciate it.
And unfortunately I need to go back a few years and scrub data for these invalid duplicates, so I just cant start cleaning data going forward.
Thanks in advance.
I have a problem with duplicates in my database that I need to remove, but the problem is that some of the duplicates are OK and need to be left alone. Let me clarify....my database imports data that uses a "key" value so that every few days an individual key can get reused. Those are OK. The ones that need to be deleted are when two duplicate keys are used on the same day.
The duplicate query I build finds all duplicates, but what it really needs to do is find duplicates that occur on the day day. If anybody could modify this to do what I need, I would greatly appreciate it.
Code:
SELECT [Executions table].[Exec ID], [Executions table].[Exec date]
FROM [Executions table]
WHERE ((([Executions table].[Exec ID]) In (SELECT [Exec ID] FROM [Executions table] As Tmp GROUP BY [Exec ID] HAVING Count(*)>1 )))
ORDER BY [Executions table].[Exec ID];
And unfortunately I need to go back a few years and scrub data for these invalid duplicates, so I just cant start cleaning data going forward.
Thanks in advance.