PC Review


Reply
Thread Tools Rate Thread

Appending Records from Table to Table

 
 
Stephen sjw_ost
Guest
Posts: n/a
 
      12th Feb 2009
Hello, Let me just say that I think you guys are the best and I appreciate
all the help you have given me in the past.

I need your help again. I have 2 databases.
DB1 has IDs in it that are used to identify my agents.
DB2 also has these IDs but is updated by managers. Managers add new agents
to DB2 as new classes come in.

So, DB2 has IDs that are already in DB1, just without all of the details of
DB1. How can I append only the records from DB2 to DB1 that are NOT already
in DB1?

I hope this makes sense.
Thank you for any help!
--
Stephen
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      12th Feb 2009
On Wed, 11 Feb 2009 19:32:02 -0800, Stephen sjw_ost
<(E-Mail Removed)> wrote:

>So, DB2 has IDs that are already in DB1, just without all of the details of
>DB1. How can I append only the records from DB2 to DB1 that are NOT already
>in DB1?


Use an "Unmatched Query" as an Append query:

INSERT INTO DB1(field, field, field, field)
SELECT field, field, field, field
FROM DB2 LEFT JOIN DB1
ON DB1.ID = DB2.ID
WHERE DB1.ID IS NULL;

Use your actual fieldnames of course.

Try it first without the first line (the INSERT INTO) to make sure it is
selecting the right records, and back up your database before running the
append!
--

John W. Vinson [MVP]
 
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
Filtered Records as source for appending records to a table 8l2255 Microsoft Access Form Coding 1 7th Dec 2009 04:18 AM
Filtered records as source for appending records to a table LanceWilliams2418@sbcglobal.net Microsoft Access 3 16th May 2008 10:27 AM
Appending new records to a table =?Utf-8?B?Q2h1Y2tX?= Microsoft Access Queries 2 21st May 2007 05:42 PM
HELP!!!! Upload table records deletes existing records instead of appending. rbagley@kodersolutions.com Microsoft Dot NET Compact Framework 1 2nd Feb 2007 09:51 AM
HELP!!!! Upload table records deletes existing records instead of appending. rbagley@kodersolutions.com Microsoft Dot NET Compact Framework 0 2nd Feb 2007 02:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:00 PM.