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 |
|
fdtoo
Starting Member
28 Posts |
Posted - 2006-04-14 : 05:44:19
|
| I have the following fields in table A: GL_ID| Date |GL_Name_VC | Amount |Period_TI|Year_SI=============================================================== 1000|31/12/2005 | Sales | -8,000.00 | 12 | 2005=============================================================== 1000|06/01/2006 | Sales | -6,000.00 | 01 | 2006=============================================================== 1000|20/01/2006 | Sales | 2,000.00 | 01 | 2006=============================================================== 1000|28/01/2006 | Sales | -4,000.00 | 01 | 2006The above database is running on Microsoft SQL Server 2000 and i would like to queryfor a report that looks something as below:Period | Date | GL_Name_VC | Debit | Credit| Net Change | Balance=====================================================================01 |01/01/2006|Opening Bal | 0 | 0 | 0 | 8,00001 |06/01/2006|Sales | 0 | 6,000 | 0 | 001 |20/01/2006|Sales | 2,000 | 0 | 0 | 001 |28/01/2006|Sales | 0 | 4,000 | 8,000 |16,000The formula for the above calculated fields are as below:Opening Balance = carried forward balance from Year 2005 Debit = All positive amount Credit = All negative amount Net Change = Total Credit - Total Debit in Period 01 Balance = Total of Net Change + Opening BalGuys, hope someone out there can help me with the sql command for the above report? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-14 : 07:20:00
|
| You have posted many questions which got replies. Continue your discussions thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|