Toad World® Forums

Toad error ORA-00936: Missing Expression

Cant figure out why i am getting error ORA-00936: Missing Expression. Can someone please help me out

SELECT ORD.ORG_CODE, ORD.DIV_CODE, ORD.ORDER_NUM, ORD.ORIG_ORDER_TYPE, ORD.CUST_NUM, CUSTOMER.CURR_CODE, ORD.ORDER_DATE, ORD.CANCEL_BY_DATE, ORD.HDR_DISC_PCT, ORD.CUST_PO_NUM, ORD.CUST_PO_DATE, ORD.FULL_ORDER_VALUE, ORD.OPEN_ORDER_VALUE, ORD.HOLD_STATUS, ORD.ORDER_STATUS, ORD.CANCELLED, ORD_L.LINE_NUM, ORD_L.HOLD_STATUS, ORD_L.CUST_NUM, ORD_L.SHIP_NUM, ORD_L.WHSE_CODE, ORD_L.ITEM_NUM, ITEM.SA_ITEM, ORD_L.PRICE_UOM, ORD_L.OPEN_ORD_QTY, ORD_L.SHIPPED_QTY, ORD_L.DISC_AMT, ORD_L.NET_PRICE, ORD_L.SLMN_NUM, ORD_L.CANCELLED_QTY, ([open_ord_qty]+[shipped_qty]*[net_price]) AS BKPAMT
FROM ORD INNER JOIN ORD_L ON ORD.ORD_ID = ORD_L.ORD_ID INNER JOIN ITEM ON ORD_L.ITEM_NUM = ITEM.ITEM_NUM INNER JOIN CUSTOMER ON ORD.CUST_NUM = CUSTOMER.CUST_NUM
WHERE ORD.ORG_CODE=‘OX’ AND ORD.ORDER_DATE > TO_DATE (‘28-FEB-15’, ‘DD-MON-RR’) AND ORD.ORDER_STATUS<>4 AND ITEM.SA_ITEM<>‘9100’ And ITEM.SA_ITEM<>‘9200’ And ITEM.SA_ITEM<>‘9201’ And ITEM.SA_ITEM<>‘9925’ And ITEM.SA_ITEM<>‘9950’

It’s hard to spot errors when your SQL is one long string of text.

The problem is the brackets:

([open_ord_qty] + [shipped_qty] * [net_price]) AS BKPAMT

I just pasted it in the editor and formatted it. then it was a lot easier to spot.

Sorry about the format. Taking brackets did fix the problem.

Thank you