Silverbird09
New Member
- Joined
- Mar 2, 2017
- Messages
- 2
Good Afternoon,
First of all I want to say I am a long time reader, first time poster on MrExcel. Because of this board, as well as others, I have become quite skilled in matters of Excel and Access (or at least been good at finding what I need at the time). However I have been unable to find the answer to my current question, perhaps I'm addressing it incorrectly.
Ok, enough of that, here is my scenario:
I have two tables with corresponding table structures. The only difference is one includes a Primary Key (MainTable), the other doesn't (ImportTable). The primary key is auto-generated during appending to MainTable. The intent is to use ImportTable to append new records into MainTable. The important columns include:
MainTable
Legacy_ID (Primary Key) -- Project_ID -- SKU_ID
ImportTable
Project_ID -- SKU_ID
The idea is to first check for duplicate SKU_ID's between the two tables before appending. However, there can be duplicates if the Project_ID's are different. I want to avoid duplicate results as shown in the example below:
MainTable (Duplicates Exist)
<tbody>
</tbody>
MainTable (No Duplicates Exist)
<tbody>
</tbody>
Hopeful I was able to explain that accurately. Thank you in advance for your thoughts and advice.
P.S. - I tried to find a similar question, but was unable to find a solution. I apologize in advance if I inadvertently duplicated this specific question.
First of all I want to say I am a long time reader, first time poster on MrExcel. Because of this board, as well as others, I have become quite skilled in matters of Excel and Access (or at least been good at finding what I need at the time). However I have been unable to find the answer to my current question, perhaps I'm addressing it incorrectly.
Ok, enough of that, here is my scenario:
I have two tables with corresponding table structures. The only difference is one includes a Primary Key (MainTable), the other doesn't (ImportTable). The primary key is auto-generated during appending to MainTable. The intent is to use ImportTable to append new records into MainTable. The important columns include:
MainTable
Legacy_ID (Primary Key) -- Project_ID -- SKU_ID
ImportTable
Project_ID -- SKU_ID
The idea is to first check for duplicate SKU_ID's between the two tables before appending. However, there can be duplicates if the Project_ID's are different. I want to avoid duplicate results as shown in the example below:
MainTable (Duplicates Exist)
Legacy_ID (Primary Key) | Project_ID | SKU_ID |
1001 | 1 | IMP-0002 |
1002 | 1 | IMP-0002 |
1003 | 2 | IMP-1013 |
1004 | 2 | IMP-3922 |
<tbody>
</tbody>
MainTable (No Duplicates Exist)
Legacy_ID (Primary Key) | Project_ID | SKU_ID |
1001 | 1 | IMP-1245 |
1002 | 1 | IMP-0002 |
1003 | 2 | IMP-1013 |
1004 | 2 | IMP-0002 |
<tbody>
</tbody>
Hopeful I was able to explain that accurately. Thank you in advance for your thoughts and advice.
P.S. - I tried to find a similar question, but was unable to find a solution. I apologize in advance if I inadvertently duplicated this specific question.