Hi Friends
Please let me know how to fetch latest transaction for the particular item for a particular transaction date..
i have the record like this.
|
| | | | 185140 | | | |
| | | | 185140 | | | |
| | | | 185140 | | | |
| | | | 185140 | | | |
| | | | 185140 | | | |
Org id , subinventory code everything same for all records.
i need 1st, 4th, 5 th row to be displayed. for 1 item , i have 3 (3rd, 4th, 5th row) transactions.
when i updated the 3rd row , 2 row created.
when i updated the 2row, 1st row creaated. So , latest transaction is 1st row. i need 1st, 4th, 5 th row to be displayed. Is there any function or package to display latest transaction of the particular transaction or any other way to fetch those records..
i used the below query. it is not coming correctly.
select mmt.actual_cost, inventory_item_id, mmt.transaction_date , mmt.transaction_quantity ,mmt.* from mtl_material_transactions mmt
where inventory_item_id = 185140
and trunc(transaction_date) = '29-APR-2014'
and transaction_type_id = 35
AND transaction_id in
(SELECT MAX (transaction_id)
FROM apps.mtl_material_transactions mmt1
WHERE TRUNC (mmt1.transaction_date) = '29-APR-2014' --TRUNC (:tnpl_correct_header.transaction_date)
AND mmt1.inventory_item_id = mmt.inventory_item_id
and mmt1.transaction_date = mmt.transaction_date
group by transaction_date)
order by mmt.transaction_date asc , mmt.transaction_id desc
Please help me.
Thanks in advance.
Mano