0
votes
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'.

please help

1
Show us the SQL query alone.jarlh
its solved anwser belowmayor568

1 Answers

1
votes

Use AS - SQL aliases are used to give a table, or a column in a table, a temporary name.

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 ";