PC Review


Reply
Thread Tools Rate Thread

Append Query - Excluding existing records

 
 
=?Utf-8?B?Q2hlY2tzNTAwMA==?=
Guest
Posts: n/a
 
      27th Jan 2006
Thanks in advance !
Having trouble with the syntax.
I have a master table and a file i receive daily. The daily has all of the
master records and some new ones. As I have enriched the master file with
other attributes I simply want to add the new records on the daily file to
the master table. Do I simply append all and rely on the primary key not
allowing me to overwrite existing records, or can i select just the records I
want as a part of the append ?
Thanks.
 
Reply With Quote
 
 
 
 
Gina via AccessMonster.com
Guest
Posts: n/a
 
      27th Jan 2006
I believe something along these lines would get you the results that you want:


INSERT INTO Master( record_id, record_data )
SELECT Daily.record_id, Daily.record_data
FROM Daily
WHERE (((Daily.record_id) Not In (SELECT record_id FROM Master)));

You just need to replace the table and field names that I made up with the
ones you are using, and add more fields if you need to.

Gina



Checks5000 wrote:
>Thanks in advance !
>Having trouble with the syntax.
>I have a master table and a file i receive daily. The daily has all of the
>master records and some new ones. As I have enriched the master file with
>other attributes I simply want to add the new records on the daily file to
>the master table. Do I simply append all and rely on the primary key not
>allowing me to overwrite existing records, or can i select just the records I
>want as a part of the append ?
>Thanks.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200601/1
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Main Switchboard can't append all the records in the append query =?Utf-8?B?U2hlbGw=?= Microsoft Access 0 2nd Jul 2007 11:34 AM
Append Records To Existing Table.... =?Utf-8?B?Qm9iIEJhcm5lcw==?= Microsoft Access 6 21st Apr 2006 02:40 PM
excluding records from a query =?Utf-8?B?Q29uc3VlbG83Nw==?= Microsoft Access Queries 1 1st Dec 2005 06:45 AM
Excluding certain records from a query Tony Microsoft Access Queries 3 24th Sep 2004 08:27 AM
Excluding records in a query Valentine Microsoft Access Queries 1 15th Jul 2003 03:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:55 PM.