Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations danielledunham on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append non-duplicates in a query

Status
Not open for further replies.

SQLWilts

Programmer
Joined
Feb 12, 2001
Messages
651
Location
GB
Hi,
I feel a little lazy asking you guys here about something this simple, but.....
I have to write a query that pulls data from a table on a remote database into an existing table in the local one.

Simple enough, with an append query, but how do I ensure that no duplicates are imported (ie new data only)?

The table is DT Master, keyed on:
SISKEY (date with shift 1-3 appended)
Coiling Unit (Text file containing Pasaban1, Pasaban2, Sulzer and Gorostidi)

TIA

Tony
 
you could create an "Unmatched" query and then use that to drive the append query.
 
Sorry, but sussed it.

I call the append query in code, turning warnings off before I run it, and turning them back on afterwards. Because the table has a unique key, it will only append unique records - or in other words, only the new records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top