title: Remove Duplicate Records MS Access SQL Microsoft
body: <p>In Access, I am able to run a SELECT Query that finds the duplicate records that I need to delete, but cannot execute a query that will delete them. </p>
  
  <p>This is the code for the query that shows me the correct records of duplicates and groups them. It shows me the 1083 records (They are grouped)</p>
  
  <pre><code>SELECT Count(tblDat01Prod.[MFG #]) AS [CountOfMFG #], Last(tblDat01Prod.[MFG #]) AS [LastOfMFG #], tblDat01Prod.[MFG #]
  FROM tblDat01Prod
  GROUP BY tblDat01Prod.[MFG #]
  HAVING (((Count(tblDat01Prod.[MFG #]))&gt;1));
  </code></pre>
  
  <p>This is the code for deleting the records, it wants to delete all records, event though I only want it to delete 1083.</p>
  
  <pre><code>DELETE tblDat01Prod.[MFG #]
  FROM tblDat01Prod
  WHERE (((tblDat01Prod.[MFG #]) In (SELECT Last(tblDat01Prod.[MFG #]) AS LastMFG
  FROM tblDat01Prod
  GROUP BY [MFG #]
  HAVING (((Count(tblDat01Prod.[MFG #]))&gt;1));)));
  </code></pre>
  
  <p>Can you please advise on how to correct?</p>