这个错误是什么意思? ([Microsoft][ODBC Excel 驱动程序] LEVEL 子句包含保留字...)
完整错误消息:“[Microsoft][ODBC Excel 驱动程序] LEVEL 子句包含拼写错误或丢失的保留字或参数,或者标点符号不正确”
当尝试在一个 Excel 文档中对表执行查询时,我收到此消息在另一个Excel文档中。我的 SQL 根本不包含 LEVEL,我在 Google 上找不到任何有用的东西。
在有人问之前:是的,我知道 Excel 不是数据库。我找不到更好的方法来从一张纸到另一张纸获取这些数据。
因为我喜欢我的工作,所以我混淆了我的 SQL;否则,它包括公司机密数据。我确信我要删除的内容的语法是正确的,因为它是我的 Microsoft Query 编写的。
SELECT `Table1$`.`Field1`, <Other Fields from Table1>,
`Table2$`.`FieldA`, <Other Fields from Table2>,
`Table3$`.`FieldX`,
`Table3$`.`FieldY`
FROM `<network path starting with \\>\<filename>.xlsb`.`Table1$` `Table1$`,
`<network path starting with \\>\<filename>.xlsb`.`Table2$` `Table2$`,
`<network path starting with \\>\<filename>.xlsb`.`Table3$` `Table3$`
WHERE `Table2$`.`Join1Field` = `Table1$`.`Join1Field`
AND `Table3$`.`Join2Field` = `Table1$`.`Join2Field`
AND `Table1$`.`Weeks Ago` < 14;
注意:所有这些表都位于同一个 Excel 文件中,我使用的是 Excel 2007。
Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
SELECT `Table1Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`Field1`, <Other Fields from Table1>,
`Table2Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`FieldA`, <Other Fields from Table2>,
`Table3Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`FieldX`,
`Table3Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`FieldY`
FROM `<network path starting with \\>\<filename>.xlsb`.`Table1Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
`Table1Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
,
`<network path starting with \\>\<filename>.xlsb`.`Table2Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
`Table2Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
,
`<network path starting with \\>\<filename>.xlsb`.`Table3Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
`Table3Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
WHERE `Table2Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`Join1Field` = `Table1Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`Join1Field`
AND `Table3Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`Join2Field` = `Table1Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`Join2Field`
AND `Table1Full error message: "[Microsoft][ODBC Excel Driver] The LEVEL clause includes a reserved word or argument that is mispelled or missing, or the punctuation is incorrect"
I get this when trying to execute a query in one excel document against a table in another excel document. My SQL doesn't include LEVEL at all, and I can't find anything useful on Google.
Before anyone asks: Yes, I know excel isn't a database. I can't find a better way to get this data from sheet to sheet.
Because I like my job, I've obfuscated my SQL; otherwise it includes company confidential data. I am certain that my syntax is right on the things that I am removing, because it was written my Microsoft Query.
.`Weeks Ago` < 14;
Note: All of these tables are in the same Excel file, and I'm using Excel 2007.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 MSDN 上的此页面,您输入的 SQL 语句具有无效的保留字或不正确的标点符号。正如 @Ken White 指出的那样,很难从编辑的 SQL 中判断发生了什么。
IIRC 当您在 MS Query 中使用 GUI 工具时,它会写入 ODBC 语法:在 Excel 端转换为本机 Access(ACE、Jet 等)语法时可能存在问题。如果您可以在没有 GUI 工具的情况下编写 SQL,或者可以使用 Access QBE 来为您完成此操作,IIRC,您可以将本机 Access SQL 语法粘贴到 MS Query 的 SQL 窗口中,它将不加更改地“传递”到 Excel。
According to this page on MSDN you entered an SQL statement that has an invalid reserved word or incorrect punctuation. As @Ken White points out, it's hard to tell from your edited SQL what is going on.
IIRC when you use the GUI tool in MS Query it writes ODBC syntax: perhaps there is a problem in translation to native Access (ACE, Jet, whatever) syntax at the Excel end. If you can write SQL without GUI tools, or can use the Access QBE thing to do it for you, IIRC you can paste native Access SQL syntax into MS Query's SQL window and it will 'pass through' to Excel unchanged.