TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ajit N
NA
352
71.5k
how to get opening and closing balance using MS Access Sql ?
Apr 13 2019 11:25 AM
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 ?
Reply
Answers (
2
)
How to view all sales order details by using SQL statment.?
Joining 3 tables and it is duplicating