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-11 : 20:19:00
|
| I have the following fields in table A: GL_ID|GL_Name_VC | Amount |Period_TI|Year_SI=================================================== 1000| Inventory| 8,000.00 | 01 | 2005=================================================== 1000| Inventory| -3,000.00 | 02 | 2005=================================================== 1000| Inventory| 5,000.00 | 02 | 2005=================================================== the fields above have the following datatype: Fields | Datatype =================================== GL_ID | Integer GL_Name_VC | Variable Character Amount | Integer Period_TI | TinyInteger Year_SI | SmallIntegerThe above database is running on Microsoft SQL Server 2000 and i would like to queryfor a report that looks something as below:GL_ID | GL_Name_VC |Op Bal|Period_Dr|Period_Cr|Period Bal|Closing Bal======================================================================1000 | Inventory |8,000 | 5,000 | -3,000 | 2,000 |10,000 The above report has an Op Bal column which is the sum of all amount in Period 01 inYear 2005 carried forward as opening balance in Period 02, Period_Dr Column would containall positive amount in Period 02 & Period_Cr Column would contain all negative amount in Period 02. Period Bal is the summation of both Period_Dr & Period_Cr and Closing Balcolumn is the summation of Op Bal + Period Bal.Guys, hope someone out there can help me with the sql command for the above report? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-11 : 21:19:07
|
Yes. Can apply same techinique as well. See my answer to your other question KH |
 |
|
|
|
|
|