G
Guest
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
(e-mail address removed)
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
(e-mail address removed)