beginning balance
We are trying to find a more efficient way to calculate beginning balance for an item. Currently we are using this query and the report takes a lot of time to run.
select nvl(sum(transaction_quantity),0)
from apps.mtl_material_transactions
where 1=1
and inventory_item_id= MSB.INVENTORY_ITEM_ID
and organization_id= MSB.ORGANIZATION_ID
and subinventory_code = : P_SUBINV
and TRUNC(transaction_date) <= TRUNC(:P_TO_DATE)