Inserting Two Identical Tables Into One Table

lhooker

Registered User.
Local time
Today, 14:53
Joined
Dec 30, 2005
Messages
431
How can I insert the below "Select" queries results (that works) in to one (1) table.

SELECT Leadership.Name, Leadership.Survey_Taker_Telephone_Number, Leadership.Type, Leadership.Type_Score, Leadership.Contact_Me
FROM Leadership
Union
SELECT Administration.Name, Administration.Survey_Taker_Telephone_Number, Administration.Type, Administration.Type_Score, Administration.Contact_Me
FROM Administration;
 
You should be able to use that as the base of an append query.
 
the query should look like this:

INSERT INTO anotherTable (
[Name],
[Survey_Taker_Telephone_Number],
[Type], [Type_Score], [Contact_Me] )
FROM
(
SELECT
Leadership.Name,
Leadership.Survey_Taker_Telephone_Number,
Leadership.Type,
Leadership.Type_Score,
Leadership.Contact_Me
FROM Leadership
UNION ALL
SELECT
Administration.Name,
Administration.Survey_Taker_Telephone_Number,
Administration.Type,
Administration.Type_Score,
Administration.Contact_Me
)
 
The adage about feeding a man for a day vice for his life.
 
Nothing to be concerned about, truly. Did you try Arnelgp’s code? I am no expert, but it looks like it will work and he is usually right!
 
Arnelgp,

Did not work, I added 'From Administration', but it did fix the problem.

INSERT INTO anotherTable ( [Name], [Survey_Taker_Telephone_Number], [Type], [Type_Score], [Contact_Me] )
(SELECT Leadership.Name, Leadership.Survey_Taker_Telephone_Number, Leadership.Type, Leadership.Type_Score, Leadership.Contact_Me
FROM Leadership
UNION ALL
SELECT Administration.Name, Administration.Survey_Taker_Telephone_Number, Administration.Type, Administration.Type_Score, Administration.Contact_Me
FROM Administration
 
Arnelgp,

I did changed 'anotherTable' to another table name.
 
pbaldy,,

OK, got it . . . I have my fishing rod. Any takers ?
 
Pat Hartman/jdraw,

Sorry for not responding ! ! ! I've off the forum for a few days. I ended up creating multiple queries and using a macro to call the queries. Thanks for following up ! ! !
 

Users who are viewing this thread

Back
Top Bottom