Skip to Content
Oct 02, 2019 at 04:40 AM

Sales Order Opened when all Items row statuses are Closed


How to edit this Query to show only if Document Status is Open when all the item rows details status is closed?

SELECT T0."DocNum",T0."DocDate", T0."CardCode", T0."DocTotal", T0."DocType",T0."DocStatus", T0."CANCELED", T1."DocEntry", T1."LineNum", T1."LineStatus", T1."TargetType", T1."TrgetEntry", T1."BaseLine",T1."ItemCode", T1."Quantity", T1."DelivrdQty", T1."OpenQty" FROM ORDR T0 INNER JOIN RDR1 T1 ON T0."DocEntry" = T1."DocEntry" WHERE T0."DocStatus" ='O' and T1."LineStatus" ='C'