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 / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

Multiple Simultaneous Appends?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EVL - 16 Apr 2005 20:05 GMT
Hi,

I have five tables - A, B, C, D, E (referring to 5 points in time) which
contain the same variables. Each table contains information for each ID over
the five time points A, B, C, D, E. I want to join all tables (i.e. append
B,C,D, and E to A) to produce one grand table called “AtoE”, so that the
information for each ID over time is contained in the same variables.  At the
moment I have to go through a long process of:

1)    Creating a new Table A with a Different Name i.e. Table A+B, which
initially contains just As information.
2)    Creating an Append query to Add A to B and putting the result in Table
A+B e.g. as follows:

INSERT INTO [TableA+B] ( ID, Variable1, Variable2, Variable3 )
SELECT TableB.ID, TableB.Variable1, TableB.Variable2, TableB.Variable3
FROM TableA LEFT JOIN TableB ON TableA.ID = TableB.ID;

3)    Repeating the equivalent step 4 times.
(i.e. after appending B unto A+B, then append C unto A+B+C, then D unto
A+B+C+D etc.)

Since, I and others will need to go through this process several times, Is
there a way of doing this all in one go i.e. via a single SQL statement or a
visual basic module?

I’d appreciate any advice on this,

Thanks in advance,

Eric Van Lente
evanlen@yahoo.co.uk
Duane Hookom - 16 Apr 2005 21:21 GMT
If the tables have similar fields, you can use a union query to create a
combined recordset of your 5 tables.
SELECT ID, Variable1, Variable2, Variable3
FROM tblA
UNION ALL
SELECT ID, Variable1, Variable2, Variable3
FROM tblB
UNION ALL
SELECT ID, Variable1, Variable2, Variable3
FROM tblC
UNION ALL
SELECT ID, Variable1, Variable2, Variable3
FROM tblD
UNION ALL
SELECT ID, Variable1, Variable2, Variable3
FROM tblE

Use this union query as the source to create a table of tblAtoE.

I trust your tables are properly normalized and you understand your
application much better than I do.

Signature

Duane Hookom
MS Access MVP

> Hi,
>
[quoted text clipped - 31 lines]
> Eric Van Lente
> evanlen@yahoo.co.uk
EVL - 18 Apr 2005 05:18 GMT
Thank you very much Duane! That was very helpful.

Eric

> If the tables have similar fields, you can use a union query to create a
> combined recordset of your 5 tables.
[quoted text clipped - 53 lines]
> > Eric Van Lente
> > evanlen@yahoo.co.uk
 
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.