Hello, I want to show the opening and closing balance which i mentioned in below image and i just want this type of output through ms access sql query.
i tried this below query but i didn't got the proper output as per my requirement.
- select Edate,OB, Cr, Dr, (OB + Cr - Dr) as Bal, srno
- from statement where srno = (select min(srno) from statement)
- union all
- select curr.edate, (curr.OB + prev.Bal), curr.Cr, curr.Dr,
- (curr.OB + prev.Bal + curr.Cr - curr.Dr) as Bal, curr.srno
- from statement curr inner join statement prev on curr.srno = prev.srno + 1
so help me how to do this using sql query ?