MSA97 syntax error in FROM clause

C

ChasW

I want to select the contents of 2 different tables into a new table.

I am doing something like:

SELECT T3.* INTO tblNEW
FROM
(SELECT * FROM TABLE1 AS T1
UNION ALL
SELECT * FROM TABLE2 AS T2) AS T3;

This is working in Access 2000, but in Access 97 I am getting, "Syntax
Error in FROM clause"

Any suggestions would be helpful.

Thank you,
Charles
 
J

John Vinson

SELECT T3.* INTO tblNEW
FROM
(SELECT * FROM TABLE1 AS T1
UNION ALL
SELECT * FROM TABLE2 AS T2) AS T3;

This is working in Access 2000, but in Access 97 I am getting, "Syntax
Error in FROM clause"

You have to use a very peculiar nonstandard syntax:

SELECT T3.* INTO tblNEW
FROM
[SELECT * FROM TABLE1 AS T1
UNION ALL
SELECT * FROM TABLE2 AS T2]. AS T3;

Note the square brackets, not parentheses, and the period after the
closing bracket; both are essential.

Or... save the UNION query joining Table1 and Table2 as uniBothTables,
and use

SELECT uniBothTables.* INTO tblNew FROM uniBothTables;

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

Top