How do I save/overwrite a SQL Union to a table? (1 Viewer)

Mike1sMike

New member
Local time
Today, 00:43
Joined
Apr 24, 2020
Messages
16
This has to be easier than I am making it. This union works fine but I am lost as to how to save the unions to a new table, say eoy2020. Thank you to anyone!

SELECT *
FROM eom0920 WHERE (((eom0920.[Row]) Is Not Null))

UNION ALL SELECT *
FROM eom1020 WHERE (((eom1020.[Row]) Is Not Null))

UNION ALL SELECT *
FROM eom1120 WHERE (((eom1120.[Row]) Is Not Null));
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:43
Joined
Oct 29, 2018
Messages
21,474
Hmm, you could try creating a Make-Table query based on your UNION query. Why?
 

Mike1sMike

New member
Local time
Today, 00:43
Joined
Apr 24, 2020
Messages
16
Hmm, you could try creating a Make-Table query based on your UNION query. Why?
Thanks, you are always my hero. An Excel sheet needs to link to this for now ( I know I know but don't have time to migrate everything into Access) so I need a table for now. I don't know the SQL syntax to turn the above into a make-table. I think I am being dumb, however nothing is obvious to the uninformed....
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:43
Joined
Oct 29, 2018
Messages
21,474
Thanks, you are always my hero. An Excel sheet needs to link to this for now ( I know I know but don't have time to migrate everything into Access) so I need a table for now. I don't know the SQL syntax to turn the above into a make-table. I think I am being dumb, however nothing is obvious to the uninformed....
Easiest way would be to save your UNION query and let's say you called it qryUNION. Then, create another query with this SQL.
SQL:
SELECT * INTO NewTableName FROM qryUNION
Hope that helps...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:43
Joined
Feb 19, 2002
Messages
43,293
Whenever you don't know the SQL Syntax, use the QBE to build your query.
 

Users who are viewing this thread

Top Bottom