Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 9057

Production Order Actual Additional Cost Query

$
0
0

I am using this query to show Production Order Variances.  There is one key part that is missing that I cannot figure out how to add the Actual Additional Cost from the summary tab to this query.  Is there a way to add this field to this query?

 

SELECT DISTINCT T0.DocNum, T0.PlannedQty, T0.CmpltQty, T1.Dscription, T0.PostDate, (T1.StockPrice*T0.CmpltQty) as 'Actual Product Cost', -sum(T2.TransValue) as 'Actual Component Cost', SUM(T2.TransValue) 'Total Variance',

(T1.StockPrice*T0.CmpltQty) +sum(T2.TransValue) as Difference

FROM OWOR T0

LEFT JOIN IGN1 T1 ON T0.DocNum=T1.BaseRef

INNER JOIN OINM T2 ON T0.DocEntry=T2.AppObjAbs AND OutQTY>0

WHERE T0.PostDate >=[%0\] AND T0.PostDate <=[%1\]

GROUP BY T0.DocNum, T0.PlannedQty, T0.CmpltQty, T1.Dscription, T0.PostDate, (T1.StockPrice*T0.CmpltQty)

 

Thanks for the help,


Viewing all articles
Browse latest Browse all 9057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>