Premahari
14th August 2018, 10:32
Hi,
I want one report which contains item,item.type,transaction1,transaction2.
From warehouse Item Transaction,for particular item last transaction i want to update in transaction1 and last before record i want to update for transaction2.
Can anyone tell how to get this?
I tried this. Its fetching last two records but don know how to assign those to transaction 1 and transaction2.

select whinr110.*
from whinr110
where whinr110._index1 = {:whwmd210.item,:tiesc000.cwar}
order by whinr110.trdt DESC
as set with 2 rows
selectdo
endselect

mark_h
14th August 2018, 15:00
Setup some record buffers or just use temp variables to assign the fields you need for transaction 1 and transaction 2. For example you could have a trans.item(2) for the item - inside the select do set trans.item(1) to the first record then trans.item(2) to the second record. Then on the report you could print trans.item(1) and trans.item(2) on the same layout. Not really sure if I am answering your question.