Tuesday, December 18, 2018

Retrieve Quantity Committed through ODBC

There are two ways to retrieve the Quantity Committed for Items. First is from the transactions:

SELECT SUM(QUANTITY_COMMITTED) FROM TRANSACTION_LINES WHERE ITEM_ID = {item_id} GROUP BY ITEM_ID

The other is from the Item - Locations mapping table:

SELECT (SUM(ON_HAND_COUNT) - SUM(AVAILABLE_COUNT)) AS QUANTITY_COMMITTED FROM ITEM_LOCATION_MAP WHERE ITEM_ID = {item_id} GROUP BY ITEM_ID

No comments:

Post a Comment