Solved

ms sql opening balance on ledger

Posted on 2006-07-12
5
1,478 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LDAP find expired users 8 73
SQL Update Query 23 93
SQL 2012 create index "incorrect syntax near 'INCLUDE'" 6 53
SQL Server - Check Constraint or NOT NULL? 11 69
This article describes some very basic things about SQL Server filegroups.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now