Nichole Broom
11/12/2020, 1:59 PMtdietrich
11/12/2020, 2:49 PMSELECT
Item.ItemID,
Item.QuantityOnHand,
Item.QuantityCommitted,
Item.QuantityOnOrder,
Item.QuantityBackordered,
(
SELECT
SUM( TransactionLine.Quantity) * -1
FROM
TransactionLine
INNER JOIN Transaction ON
( Transaction.ID = TransactionLine.Transaction )
WHERE
( TransactionLine.Item = Item.ID )
AND ( Transaction.Type = 'SalesOrd' )
AND ( TRUNC( SYSDATE ) - Transaction.TranDate <= 90 )
) AS QuantitySold90Days
FROM
Item
WHERE
Item.ID = 999999
I'm not using the inbound function, but there are two tables that are available that you could use to get the total qty in transit: InboundShipment and InboundShipmentItem. The second table has a "quantityremaining" column, and I think that's what you'd want to sum up.
I hope that helps.Nichole Broom
11/12/2020, 4:12 PM