Skip to Content
0

IsCommitted only for approved orders

Feb 21 at 08:36 AM

17

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

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

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]

Share
10 |10000 characters needed characters left characters exceeded