Hello friends...here Is My Query
select TRAN_AMOUNT AS CLOSING_BAL
From LOANTRAN
WHERE TRAN_DATE IN ( select AC_CLOSEDT from LNMASTER
where AC_NO BETWEEN 100 AND 200 )
AND ROWID IN ( SELECT MAX(ROWID) FROM LOANTRAN
WHERE TRAN_ACNO BETWEEN 100 AND 200)
Actually problem is, I want to create a crystal report with some account no and their closing balance.
Here is Demo Of LOANTRAN Tbl...
TRAN_ACNO TRAN_DATE TRAN_AMOUNT
1 2/2/2001 2000
2 2/2/2001 1500
3 2/2/2001 3000
2 2/2/2001 3700
3 2/2/2001 4500
I want to select last transection of One Perticular TRAN_ACNO .. in Above Example there are two times entry of Ac.No 2 in a single day..That means The Amount 3700 Is a closing Balence Of Acount No 2...(Closing Balance Means Last transection of any Account on that Single Day.. Ac.No 3 has Closing Balance 4500) i want to select such Closing Balance from LOANTRAN table of Account no Between 100 AND 200...
Please help Me.....
Kumar
Oracle Developer
[DELETED]@yahoo.co.in
[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know - OriginalGriff[/edit]
[edit2]Just cleaned up the sql so that it's easier to parse visually - Marcus[/edit2]