使用sql查询的分类帐报告 [英] Ledger Report using sql query

查看:72
本文介绍了使用sql查询的分类帐报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI。

我希望sql查询中的分类帐报告返回月度报告

作为期初余额|信贷金额|借方金额|结算余额。

另外关闭应该是第二天的开幕。



请任何人发给我询问



我的数据像这个



n_srno | d_Date | n_amount

1 | 2014-04-01 | 2000

2 | 2014 -04-05 | -500

3 | 2014-05-03 | 1000



结果如

N_srno开立信用卡借记日期

1 2014-04-01 0 2000 0 2000

2 2014-04-05 2000 0 -500 1500

HI.
I want the ledger report in sql query which return monthwise report
as opening Balance|Credit Amt|Debit Amt|Closing Balance.
Also Closing should be the opening of next day.

Please any one send me query

My Data like this

n_srno|d_Date |n_amount
1 |2014-04-01 |2000
2 |2014-04-05 |-500
3 |2014-05-03 |1000

Result like
N_srno Date opening credit debit closing
1 2014-04-01 0 2000 0 2000
2 2014-04-05 2000 0 -500 1500

推荐答案

你在寻找这个吗?



SELECT n_srno,case n_amount

当< 0然后'借记'......



如果是这种情况那么你需要做很多事情。不知何故,你需要确定credit和closing_bal之间的区别。如果不了解您的数据,我不确定如何做到这一点。
Are you looking for this?

SELECT n_srno, case n_amount
when < 0 then 'debit'...

if that is the case then you will need to do quite a bit. Somehow you will need to determine the difference between credit and closing_bal. I am not sure how you would do this without understanding your data more.


这篇关于使用sql查询的分类帐报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆