?
Solved

Append table without duplicate value

Posted on 2009-12-17
2
Medium Priority
?
341 Views
Last Modified: 2013-11-29
I am using the following codes to append table 1 to table 2.

CurrentDB.Execute "INSERT INTO tbl_Data2 (field1, field 2, field 3) SELECT [Valume1], [Valume 2], [Valume 3] FROM tbl_Data1", dbFailOnError

But it creates duplicate data in table 2. How can I set filter to append only record that have field 1 and filed 2 are not into table 2?

Thanks,
0
Comment
Question by:rowfei
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 26073540

test this

INSERT INTO tbl_Data2 ( Field1, field2, field3 )
SELECT tbl_Data1.[valume 1], tbl_Data1.[valume 2], tbl_Data1.[valume 3]
FROM tbl_Data1 LEFT JOIN tbl_Data2 ON (tbl_Data1.[valume 1] = tbl_Data2.field1) AND (tbl_Data1.[valume 2] = tbl_Data2.field2)
WHERE (tbl_Data2.field1) Is Null AND (tbl_Data2.field2) Is Null
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26096349
What are you waiting for, didn't capricorn1's comment solve your problem!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question