stormin_norm
Registered User.
- Local time
- Today, 12:18
- Joined
- Apr 23, 2003
- Messages
- 213
My head is spinning from reading posts from every website on the best method for deleting dups. I could use some direction on the best method and sql/vba code to do this:
I have two dbs, I want to merge these 2 high school tables. Problem is each table has dups and then I want to merge as unique. I can't do a select unique because the HS_ID is different in each.
Here is an example:
A_HS (in DB1)
HSid HSname HSaddress HScity HSstate HSotherInfo
1, JB HS, 1313 Mockingbird Lane, Somewhere, NY, zaxakjdjd
2, XX HS, 1 Main Street, Here, NY, jdjdkdkd
3, JB HS, 1313 Mockbird Street, Somewhere, NY, aaaaaaaa
I have to first dedup 1 & 3 by looking only at Name, City, State keeping record 1 (doesn't actually matter which one I keep). THEN make this the 'master HS table'. so have to merge in 'address' & 'other info' after the dedup.
NEXT- Do the same thing for table B in the other db. to reduce dups internal to this db.
B_HS (in DB2)
HSid HSname HSaddress HScity HSstate HSotherInfo
1, JB HS, 1313 Mockingbird Lane, Somewhere, NY, zaxakjdjd
2, YY HS, 1 Main Street, Here, NY, jdjdkdkd
3, YY HS, 1 Main Street Suite B, Here, NY, bbbbbbbbb
200, JB HS, 1313 Mockbird Street, Somewhere, NY, ccccccccccc
THEN- Merge the B info A skipping dups, add only 'new recs' like YY
During each step I have to point back to the student and change their HSID to this new HS table. lets call it C_HS.
I have two dbs, I want to merge these 2 high school tables. Problem is each table has dups and then I want to merge as unique. I can't do a select unique because the HS_ID is different in each.
Here is an example:
A_HS (in DB1)
HSid HSname HSaddress HScity HSstate HSotherInfo
1, JB HS, 1313 Mockingbird Lane, Somewhere, NY, zaxakjdjd
2, XX HS, 1 Main Street, Here, NY, jdjdkdkd
3, JB HS, 1313 Mockbird Street, Somewhere, NY, aaaaaaaa
I have to first dedup 1 & 3 by looking only at Name, City, State keeping record 1 (doesn't actually matter which one I keep). THEN make this the 'master HS table'. so have to merge in 'address' & 'other info' after the dedup.
NEXT- Do the same thing for table B in the other db. to reduce dups internal to this db.
B_HS (in DB2)
HSid HSname HSaddress HScity HSstate HSotherInfo
1, JB HS, 1313 Mockingbird Lane, Somewhere, NY, zaxakjdjd
2, YY HS, 1 Main Street, Here, NY, jdjdkdkd
3, YY HS, 1 Main Street Suite B, Here, NY, bbbbbbbbb
200, JB HS, 1313 Mockbird Street, Somewhere, NY, ccccccccccc
THEN- Merge the B info A skipping dups, add only 'new recs' like YY
During each step I have to point back to the student and change their HSID to this new HS table. lets call it C_HS.