Ask questions via twitter! Message any question to @answers on twitter. We'll publish the question and send you a reply each time there's a new answer.
Next Question

Answered Question

 
 M¢25  Funded By Mahalo ? |  February 22, 2009 01:02 AM

isolate duplicates from an SQL DB call in VB and take action on the earliest result to eliminate dups.

I have an Access database that i need to iterate through, isolate the duplicates, and modify a property to eventually eliminate the duplicates from the database.
Interesting Question?  Yes (0)   No (0)   
RSS
 
 

Best Answer  Chosen by Asker

 
February 23, 2009 02:29 AM
I can think of some very round-about ways to maybe do this with VBA, but I can't be sure it will work and I don't know enough about your data. Are there duplicate records in a table? Do the records have unique record IDs (primary key)?

To get rid of duplicate records in the data table, create a make table query using the table as the data source. Select all of the fields and either group the query (this will basically stack identical records together since you are grouping by all fields) or right click in the query design area and select "Yes" for "return only unique records". Run the query to create the new table and then replace your old table (after backing it up of course).
Source(s):
My braaaaaiiinnzz



Helpful Answer?  (0)   (0)    Tip jth007 for this answer
Permalink | Report
   Reply  
 
 

Other Answers (1)

Sort By
 
February 22, 2009 10:49 PM
A fairly easy way would be to make a query with a sort clause that will order the results according to the duplicated data.
At this point you go through the results and when you find that the current record is identical to the previous one you just remove it.

Helpful Answer?  (0)   (0)    Tip alfy for this answer
Permalink | Report
   Reply  
 
 

Answer this Question

How tips and payments work

This question has already been resolved. You may add an answer to it but you will not be eligible to win best answer or any associated tips.

Ask a Question


140 characters left
Top of Page
Buy Mahalo Dollars with Credit Card or PayPal

Top Members

This Week All Time
  • buddawiggi
    buddawiggi
    2nd Degree Black Belt
    28118 Points
    M$810.91 Earned
  • opher
    opher
    Purple Belt
    4949 Points
    M$207.34 Earned
  • annelisle
    annelisle
    Purple Belt
    3456 Points
    M$104.22 Earned
   See All
 

Most Popular Tags

mahalo(1648)
music(471)
iphone(468)
google(364)
food(329)
online(298)
beer(281)
money(267)
movies(267)
apple(253)
aotd(235)
health(223)
video(210)
free(208)
dog(205)
   See All
 

Categories

Welcome New Members


 
 
Mahalo Dollars are the currency of Mahalo Answers.

Each Mahalo Dollar costs $1.

Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More

 
 

Please log in to use this function.