我想要一个 sql 2008 中的代码,它将添加下表的先前余额。喜欢
Balance= + Debit
Balance= -Credit
AccountReceivable
+----+------------+----------+----------+----------+---------+-------+--------+---------+-----+
| ID | AR_Date | Ref_No | Acc_Code | Acc_Name | Details | Debit | Credit |Balance | |
+----+------------+----------+----------+----------+---------+-------+--------+---------+-----+
| 1 | 2013-04-10 | | 101 | A/R | Kofi | 500 | | 0 | |
| 2 | 2013-04-10 | | 101 | A/R | AMA |0 | | 250 | |
| 3 | 2013-04-11 | CH552778 | 101 | A/R | Boss | 0 | | 50 | |
+----+------------+----------+----------+----------+---------+-------+--------+---------+-----+