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
manoj kumar
NA
225
21.5k
Oracle query credit,debit and balance calculate
Apr 10 2017 7:47 AM
SELECT NARRATION,PARTICULARS,TO_CHAR(VOUCHER_DATE,'dd-Mon-yyyy') VOUCHER_DATE, nvl(CREDIT,0) RECEIPT, NVL(DEBIT,0) PAYMENT,
NVL(CREDIT,0) - nvl(DEBIT,0) BALANCE,SUM (NVL(CREDIT,0) - nvl(DEBIT,0)) OVER (PARTITION BY VOUCHER_DATE ORDER BY ROWNUM) CUM_BAL
FROM EGMSDBA.VOUCHER_DETAILS
WHERE NARRATION IN ('Cash Receipt','Cash Payment','Cash Deposit') AND VOUCHER_DATE BETWEEN '01-Apr-2016' AND '01-Apr-2017'
ORDER BY VOUCHER_DATE,VOUCHER_SL_NO;
NARRATION PARTICULARS DATE RECEIPT PAYMENT BALANCE
------------------ ----------------------- ----------- ----------------- ----------------- ---------------------
Cash Receipt Aroma Agrotech Pvt Ltd 21-Feb-2017 100000 0 100000
Cash Payment Dalmir S/O Surat Singh 21-Feb-2017 0 550 94500
Cash Payment Dilbag S/O Ramkishan 21-Feb-2017 0 2500 92000
Cash Payment Dilbagh S/O Sewa 21-Feb-2017 0 1700 90300
Cash Deposit Canara Banks 21-Feb-2017 0 10000 80300
Cash Receipt Aroma Agrotech Pvt Ltd 22-Feb-2017 20000 0 20000
Cash Receipt Bayer India Ltd 22-Feb-2017 15500 0 35500
Cash Receipt Haryana Ware House 22-Feb-2017 14000 0 49500
I WANT TO NEED THIS RESULT SHOW BELOW
NARRATION PARTICULARS DATE RECEIPT PAYMENT BALANCE
------------------ ----------------------- ----------- ----------------- ----------- ------------
Cash Receipt Aroma Agrotech Pvt Ltd 21-Feb-2017 100000 0 100000
Cash Payment Dalmir S/O Surat Singh 21-Feb-2017 0 550 94500
Cash Payment Dilbag S/O Ramkishan 21-Feb-2017 0 2500 92000
Cash Payment Dilbagh S/O Sewa 21-Feb-2017 0 1700 90300
Cash Deposit Canara Banks 21-Feb-2017 0 10000 80300
Cash Receipt Aroma Agrotech Pvt Ltd 22-Feb-2017 20000 0 100300
Cash Receipt Bayer India Ltd 22-Feb-2017 15500 0 115800
Cash Receipt Haryana Ware House 22-Feb-2017 14000 0 129800
Reply
Answers (
1
)
Connect ORACLE 10g with VS 2012 using server Explorer
when i execute my query i don't get the needed result