Skip to Content
avatar image
Former Member

IsCommitted only for approved orders

Hi, When I create a Salesorder I have a field on each row with this Query:

SELECT T0.[IsCommited] FROM OITW T0 WHERE T0.[WhsCode] = $[RDR1.WhsCode] AND T0.[ItemCode] = $[RDR1.ItemCode]

But I only want to see how many IsCommited to Approved orders. As now it counts it even if its on an Not Approved order (ORDR.Confirmed)

Can someone please help me. /David

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Feb 21 at 09:44 AM

    Solved it myself..

    SELECT ISNULL((select sum(t.OpenQty) from rdr1 t inner join ordr X1 ON t.DocEntry = X1.DocEntry where t.ItemCode = i.ItemCode AND X1.Confirmed = 'Y'), 0) AS IsCommited FROM OITW i WHERE i.[WhsCode] = $[RDR1.WhsCode] AND i.[ItemCode] = $[RDR1.ItemCode]

    Add comment
    10|10000 characters needed characters exceeded