Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
poornima
Starting Member
32 Posts |
Posted - 2006-10-24 : 05:00:46
|
| HelloI have designed a balance sheet which works well in excel,its simple containing columns date,reason(fordebit/credit),credit,debit,balance.If i enter the credit amount it gets added to the balance,if the amount is debited,it gets subtracted from the balance.How do design the above in SQL Thanks In Advance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-10-24 : 05:05:22
|
| [code]SELECT q.SNo, CONVERT(varchar, q.Date, 102) Date, q.Reason, q.Credit, q.Debit, (SELECT SUM(x.Credit - x.Debit) FROM MyTable x WHERE x.Date <= q.Date) BalanceFROM MyTable q[/code]Peter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-24 : 05:19:44
|
| If you use Reports like Crystal Reports, you make use of formula and Running Total feature FormulaCredit-Debitand create Running total based on thatMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|