make union query into make-table query

G

Guest

I have the following:

SELECT
tbl_masterpop_new.[Loan Acct #], tbl_masterpop_new.Status,
tbl_masterpop_new.PopEnterDt
FROM tbl_masterpop_new
UNION ALL SELECT
tbl_masterpop.[Loan Acct #], tbl_masterpop.Status, tbl_masterpop.PopEnterDt
FROM tbl_masterpop;

which only displays the results of the query. I would like to rewrite the
query so that the results are made into a table called tbl_history

thanks in advance,
geebee
 
G

Guest

SELECT *
INTO tbl_history
FROM (
SELECT tbl_masterpop_new.[Loan Acct #],
tbl_masterpop_new.Status,
tbl_masterpop_new.PopEnterDt
FROM tbl_masterpop_new
UNION ALL
SELECT tbl_masterpop.[Loan Acct #],
tbl_masterpop.Status,
tbl_masterpop.PopEnterDt
FROM tbl_masterpop);
 
J

John Vinson

I have the following:

SELECT
tbl_masterpop_new.[Loan Acct #], tbl_masterpop_new.Status,
tbl_masterpop_new.PopEnterDt
FROM tbl_masterpop_new
UNION ALL SELECT
tbl_masterpop.[Loan Acct #], tbl_masterpop.Status, tbl_masterpop.PopEnterDt
FROM tbl_masterpop;

which only displays the results of the query. I would like to rewrite the
query so that the results are made into a table called tbl_history

thanks in advance,
geebee

You can't.

What you CAN do is save this query as uniAllPop and then base a
MakeTable query upon it. I'd actually recommend creating your
tbl_history table first so you can control the field sizes, indexes,
etc. and using an Append query instead:

INSERT INTO tblHistory([Loan Acct #], [Status], [PopEnterDt])
SELECT [Loan Acct #], [Status], [PopEnterDt]
FROM uniAllPop;

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

query differences 1
unwanted duplicate loan account numbers 1
query not acting right 5
DUPLICATE QUERY results 1
duplicate records 3
query from form 8
query error 3
nested query 9

Top