Skip to Content
0
Former Member
Apr 26, 2012 at 04:19 PM

Difference in BOM and Production order

267 Views

Dear Experts,

I was trying to make a query to know the difference between BOM and production order.

SELECT T0.[DocNum], T0.[ItemCode], T0.[PostDate], T0.[CmpltQty], T0.[WOR1Count],Count(T1.[LineNum]) as 'Original line no.',(T0.[WOR1Count] - Count(T1.[LineNum])) as 'Difference' FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[LineNum] <> T0.[WOR1Count] GROUP BY T0.[DocNum], T0.[ItemCode], T0.[PostDate], T0.[CmpltQty], T0.[WOR1Count]

The above query is not giving me accurate result it is also showing me production orders and BOM in which there is no difference.

Thanks-
Mona.