Sunday, February 19, 2012

"Invalid Bracketing of name"

I imported this data base from access 97 to access 2000 and it works but when I try to add any thing it gives me the "Invalid Bracketing of name" error the orignal sql has 7 UNION SELECT statements simalar to the two shown hereand works fine
but we will need to add more tables shortly
can any guru help please

SELECT U.[Machine Name], U.[Part Number], U.Description, U.Programs
FROM [SELECT
"Mori" as [Machine Name],
[Part Number],
[Description],
[Programs]
FROM Mori
UNION SELECT
'LE' as [Machine Name],
[Part Number],
[Description],
[Programs]
FROM LE
]. AS U;This is bad SQL syntax. Try using:SELECT U.[Machine Name], U.[Part Number], U.Description, U.Programs
FROM (SELECT
"Mori" as [Machine Name],
[Part Number],
[Description],
[Programs]
FROM Mori
UNION SELECT
'LE' as [Machine Name],
[Part Number],
[Description],
[Programs]
FROM LE) AS U; If it complains about the semi-colon at the end, remove that too.

-PatP|||Originally posted via PM by vern1959
THANK YOU FOR THE HELP
WERID THING THOUGH I CHANGED THE [] TO () AND DELITED THE
. JUST BEFORE "AS U" IT RUNS GREAT WHATS WERID IS WHEN I SAVE
AND EXIT THE SQL EDITOR AND RE OPEN THE SQL TO EDIT IT
THE [] and " . "are back and any attempt to edit causes the original error
"BUT" when I replace the () and delite the " . " it work but saves as described above again is this normal ? Vern posted this as a PM, but I'm responding here in case others are reading this thread or have comments to offer.

I've never seen that behavior in Access-2000 before. This smells of DAO, which was the default for Access-97, but I can't remember having seen it there either.

-PatP

No comments:

Post a Comment