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 ";
每当我执行此查询时,我都会收到以下错误 -
查询表达式中的语法错误(缺少运算符)'(数量* UnitPrice)ExtendedPrice'。
请帮助
答案 0 :(得分:1)
使用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 ";