MS Access

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Tutorialized ForumsDatabasesMS Access

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
Unread Tutorialized Forums Sponsor:
Old September 16th, 2015, 10:25 AM
lquigley lquigley is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
Join Date: Sep 2015
Posts: 1 lquigley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 37 sec
Reputation Power: 0
Delete duplicate records but keeping the first

Thanks guys I already got an answer from another forum

I am new to access. Using Access 2010. I am working trying to delete duplicate records from a table.
I have set a unique key to the table [tbl_Cmbn_RateSheetTerms_Audit_Collapsed] in order to identify duplicate data within the table for the field [RATESHEETCODE]
I then created a query [qry_000e_list_of_firsts_RS_collapsed] to identify the first record of the duplicates here is the SQL: SELECT First(tbl_Cmbn_RateSheetTerms_Audit_Collapsed.Uniq ueKey) AS FirstOfUniqueKey, tbl_Cmbn_RateSheetTerms_Audit_Collapsed.RATESHEETC ODE FROM tbl_Cmbn_RateSheetTerms_Audit_Collapsed GROUP BY tbl_Cmbn_RateSheetTerms_Audit_Collapsed.RATESHEETC ODE;

I then created a query [qry_000f_list_to_delete_RS_collapsed] to identify the records that need to be deleted. I used my original table tbl_Cmbn_RateSheetTerms_Audit_Collapsed and the query qry_000e_list_of_firsts_RS_collapsed linked them by unique key here is the SQL: SELECT tbl_Cmbn_RateSheetTerms_Audit_Collapsed.UniqueKey, tbl_Cmbn_RateSheetTerms_Audit_Collapsed.ReportMont hYr, tbl_Cmbn_RateSheetTerms_Audit_Collapsed.RATESHEETC ODE
FROM tbl_Cmbn_RateSheetTerms_Audit_Collapsed LEFT JOIN qry_000e_list_of_firsts_RS_collapsed ON tbl_Cmbn_RateSheetTerms_Audit_Collapsed.[UniqueKey] = qry_000e_list_of_firsts_RS_collapsed.[FirstOfUniqueKey]
WHERE (((qry_000e_list_of_firsts_RS_collapsed.FirstOfUni queKey) Is Null));

I am now trying to create a third and final query to delete the duplicates from the original table. I was attempting to do this using dlookup but I can't figure it out. HELP PLEASE!!!!

Last edited by lquigley : September 16th, 2015 at 11:28 AM. Reason: Figured it out

Reply With Quote

Viewing: Tutorialized ForumsDatabasesMS Access > Delete duplicate records but keeping the first

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap