SQL - Order Error - Order says 'Open Invoice ()'
v7,v6
The problem? The order cannot be converted to an invoice as it says it is on an open invoice when it is not. To check if order is on an open invoice run query below; select * from "Inw_Goods_Items" IGI join "Inw_Goods_Main" IGM on IGM."Ref_Number" = IGI."Ing_Num" where IGI."Ord_Num" = 100000xxxxx //change order number here and IGM."Status" in (2,5) To fix; run query below and all orders will be checked. If open invoice doesn't exist then the Open Inv () message will be removed. If message doesn't get removed there will be a open invoice that they will need to find then finish/cancel. update "Order_Main" OM set "Open_Inv" = 'N' where OM."Open_Inv" = 'Y' and not exists (select * from "Inw_Goods_Items" IGI join "Inw_Goods_Main" IGM on IGM."Ref_Number" = IGI."Ing_Num" where IGI."Ord_Num" = OM."Ref_Number" and IGM."Status" in (2,5))