Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Merging Two Tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Francis Cunningham, Jr. - 29 Mar 2007 19:56 GMT
Hi,
I have a Table A and a Table B.  Can I merge Table B into Table A.  Both
tables have the exact same fields, primary fields and properties. End result
being a larger table A then deleting table B.
Thanks
Frank
Jeff Boyce - 29 Mar 2007 20:10 GMT
Francis

If  you are assured there's no possibility of duplicates in the two tables,
one approach would be to create a query using TableB.  Then convert that
query to an append query, to append TableB's records to TableA.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hi,
> I have a Table A and a Table B.  Can I merge Table B into Table A.  Both
[quoted text clipped - 3 lines]
> Thanks
> Frank
Douglas J. Steele - 29 Mar 2007 20:29 GMT
And if there is a chance of duplicates in the two tables, have the query
only return the records that only exist in TableB.

The SQL will look something like:

INSERT INTO TableA (Field1, Field2)
SELECT Field1, Field2
FROM TableB
WHERE TableB.Field1 NOT IN (SELECT Field1 FROM TableA)

or

INSERT INTO TableA ( Field1, Field2 )
SELECT TableB.Field1, TableB.Field2
FROM TableB LEFT JOIN TableA
ON TableB.Field1 = TableA.Field1
WHERE TableA.Field1 Is Null

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Francis
>
[quoted text clipped - 15 lines]
>> Thanks
>> Frank
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.