Solved

ms sql opening balance on ledger

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article describes some very basic things about SQL Server filegroups.
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
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…

813 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

11 Experts available now in Live!

Get 1:1 Help Now