Solved

ms sql opening balance on ledger

Posted on 2006-07-12
5
1,507 Views
Last Modified: 2010-10-04
Sir, I am using two table for posting my vouchers and I am using following code for displaying ledger of each account

select b.Acc_ID, a.VCreateDate, b.Naration, b.Debit, b.Credit  from AC_VCHRMASTER a join AC_VCHRDETAIL b on a.VCHR_NO=b.VCHR_NO where Acc_id='1003001001' and VCreateDate >='07/01/2006' and VCreateDate <='07/29/2006'

Result:
Acc_ID                       VCreateDate                             Naration     Debit        Credit
1003001001      2006-07-12 00:00:00.000      fdfd      .00      1010.000000

Before defined period transaction user want add one list namely Opening Balance and amount on debit or credit whatever actual. How to calculate amount before define period transcation. through create view or else

Please help.

Rgds.
Mehram
0
Comment
Question by:Mehram
  • 3
5 Comments
 
LVL 7

Expert Comment

by:assyst
ID: 17089656
you have to maintain a seperate table for storing the opening balance.
Here you can store the financial year too...

Thanks
0
 
LVL 7

Accepted Solution

by:
assyst earned 500 total points
ID: 17089663
Addition...to the above comment...

Like if you have a table maintaining the financial year, you can add one more col and store the opening balance there.
0
 

Author Comment

by:Mehram
ID: 17091457
Sir, for example I am working in year 2005 and month is currently going on Nov-05, its mean is that the database have data from Jun to Nov-05 but user is select period for ledger from sep to nov-05 for which the past two month (july and aug would not be display but the balance would be come on report of past two month.

Please help.
Rgds.
Mehram
0
 
LVL 7

Expert Comment

by:assyst
ID: 17098874
Hi Mehram,

Are you maintaining closing balance for every month. If so you make a stored procedure and call that in the particular report. You can get the closing balance directly or by using a cursor inside the stored proc and then put all the result in a temporary table and you can use this table for populating data in the report. You can make use of # tables for this purpose so that no need to maintain a seperate table in your database.
0
 

Expert Comment

by:apples1234
ID: 33828630
Does anyone have an ERD or DB schema for a general ledger application like Quickbooks?
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question