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

out of stock report

$
0
0

hi experts

 

I run this simple query to show me all the items which I am awaiting stock on.

 

SELECT distinct t0.[ItemCode]'Item No.', T0.[ItemName]'Item Description', T1.[OnHand], T1.[IsCommited]'Committed', T1.[OnOrder], T3.[DocNum]'P/O Number', T2.QUANTITY'P/O Quantity', T2.[ShipDate]

 

FROM

OITM T0 INNER JOIN

OITW T1 ON T0.ItemCode   =T1.ItemCode INNER JOIN

POR1 T2 ON T0.ItemCode   =T2.ItemCode INNER JOIN

OPOR T3 ON T2.DocEntry    =T3.DocEntry

 

WHERE T1.[OnHand] <  T1.[IsCommited] and  T0.[InvntItem] = 'Y' and  T0.[QryGroup62] = 'y' and  T1.[WhsCode] = 'burn001' and T0.[U_StkStat] = 'N' and (( T3.[DocStatus] = 'o' and  T2.[LineStatus] = 'o')) 

 

GROUP BY T0.[ItemCode], T0.[ItemName], T1.[OnHand], T1.[IsCommited], T1.[OnOrder], T3.[DocNum], T2.QUANTITY, T3.[DocDueDate], T2.[ShipDate]

 

ORDER BY T0.[ItemCode]]

 

I would like to refine it to ONLY show one row for each item code.   The criteria for this row should be to show the PO number, Qty and Ship Date for the EARLIEST expect PO.

 

 

i think it needs  sub select but I can't figure how to start


Viewing all articles
Browse latest Browse all 8705

Trending Articles



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