Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / September 2006

Tip: Looking for answers? Try searching our database.

MSA97 syntax error in FROM clause

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChasW - 12 Sep 2006 05:07 GMT
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
John Vinson - 12 Sep 2006 06:27 GMT
>SELECT T3.* INTO tblNEW
>FROM
[quoted text clipped - 4 lines]
>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]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.