简体   繁体   English

查询表达式'(数量*单价)ExtendedPrice'中的MS访问语法错误(缺少运算符)

[英]Ms-access Syntax error (missing operator) in query expression '(Quantity * UnitPrice) ExtendedPrice'

OleDbConn.ole = "SELECT ProductCode, Description, Quantity, UnitPrice, (Quantity * UnitPrice) ExtendedPrice FROM SalesReturnItem sri INNER JOIN Product p ON p.ProductNo = sri.ProductID WHERE Sri.InvoiceNo = " 
+ invoiceNo + " ORDER BY Description ";

Whenever i excute this query i get the following error- 每当我执行此查询时,我都会收到以下错误-

Syntax error (missing operator) in query expression '(Quantity * UnitPrice) ExtendedPrice'. 查询表达式“(Quantity * UnitPrice)ExtendedPrice”中的语法错误(缺少运算符)。

please help 请帮忙

Use AS - SQL aliases are used to give a table, or a column in a table, a temporary name. 使用AS-SQL别名用于为表或表中的列提供临时名称。

OleDbConn.ole = "SELECT ProductCode, Description, Quantity, UnitPrice, (Quantity * UnitPrice) AS ExtendedPrice FROM SalesReturnItem sri INNER JOIN Product p ON p.ProductNo = sri.ProductID WHERE Sri.InvoiceNo = " 
+ invoiceNo + " ORDER BY Description ";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法查询MS Access数据库:“查询表达式中的语法错误(缺少运算符)” - Unable to query MS Access database: “Syntax error (missing operator) in query expression” 在 C# 中为 MS Access 查询表达式中出现语法错误(缺少运算符) - Getting a syntax error (missing operator) in query expression in C# for MS Access C# MS Access 中具有多个内部联接的查询表达式中的语法错误(缺少运算符) - Syntax Error (Missing Operator) in query expression with Multiple Inner Join in C# MS Access MS-Access查询语法 - MS-Access Query Syntax 多个参数-查询表达式中字符串的语法错误:带MS-Access 2003的VS 2010 - multiple Parameters - Syntax error in string in query expression: VS 2010 with MS-Access 2003 语句中查询表达式中的语法错误(缺少运算符) - Syntax error (missing operator) in query expression in statement 查询表达式'[Code] IN('中的语法错误(缺少运算符) - Syntax error (missing operator) in query expression '[Code] IN(' 查询表达式中缺少语法错误运算符 - syntax error missing operator in query expression 查询表达式“”中的语法错误(缺少运算符) - Syntax error (missing operator) in query expression “” 查询表达式中的语法错误(缺少运算符) - Syntax error (missing operator) in query expression
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM