Using Append Query

G

Guest

Hi ,

How can I use append query which only append the new record which I will not
get duplicate record appended.

Thanks

DLAM
 
V

Van T. Dinh

If you define proper Unique Index (or Primary Key) in your Table, the
"duplicate Records" will not be appended. Note that you will need to set
the Unique Index in accordance with what you consider as duplication.
 
G

Guest

Hi Van,

Thanks for the answer, but I still don't know what to do. I made the Append
Query from 2 tables. Those 2 tables are from another program which I can not
change anything. Is there another way to do that. All I need to is when I run
that Appen Query which only Append new records to the append table and the
unique control will be a invoice number.

Thanks

DLAM
 
V

Van T. Dinh

You can use an Append Query with an SQL String like:

INSERT INTO tblDest (InvoiceNo, Field1, Field2, ...)
SELECT tblSrc.InvoiceNo, tblSrc.Field1, tblSrc.Field2, ...
FROM tblSrc
LEFT JOIN tblDest ON tblSrc.InvoiceNo = tblDest.InvoiceNo
WHERE tblDest.InvoiceNo Is Null
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top