0% found this document useful (0 votes)
203 views

Inventory Aging Query

This SQL query selects data from multiple Oracle application tables to retrieve on-hand quantities including the date received, age in days, item code, organization, quantity, subinventory, and transaction type for items received within a specified number of days from the current date for a given organization. The query joins the mtl_onhand_quantities, mtl_material_transactions, mtl_transaction_types, and mtl_system_items_kfv tables to retrieve the relevant data.

Uploaded by

Puneet
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
203 views

Inventory Aging Query

This SQL query selects data from multiple Oracle application tables to retrieve on-hand quantities including the date received, age in days, item code, organization, quantity, subinventory, and transaction type for items received within a specified number of days from the current date for a given organization. The query joins the mtl_onhand_quantities, mtl_material_transactions, mtl_transaction_types, and mtl_system_items_kfv tables to retrieve the relevant data.

Uploaded by

Puneet
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT moq.

date_received,
(TRUNC (SYSDATE) - TRUNC (moq.date_received)) age_in_days,
moq.inventory_item_id, msib.concatenated_segments item_code,
moq.organization_id, moq.transaction_quantity, moq.subinventory_code,
mtt.transaction_type_name
FROM mtl_onhand_quantities moq,
mtl_material_transactions mmt,
mtl_transaction_types mtt,
mtl_system_items_kfv msib
WHERE moq.create_transaction_id = mmt.transaction_id
AND mmt.transaction_type_id = mtt.transaction_type_id
AND moq.organization_id = NVL (:p_org_id, moq.organization_id)
AND msib.organization_id = moq.organization_id
AND msib.inventory_item_id = moq.inventory_item_id
AND TRUNC (moq.date_received) BETWEEN TRUNC (SYSDATE) - :p_days
AND TRUNC (SYSDATE)

You might also like