.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Query for Available Balance & Ledger Balance

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
Hi, I have a web page that allows user to make transaction and they are allowed to choose if they want their transaction to be immediately transferred to the payee or for future transfer. I have problem handling future transfer, for an example, I want to transfer $100 to A on 12 August but today is only 09 August. So the amount should be deducted . I decided to make 2 balances; Available and Ledger balances. Available balance is the net balance after doing all the future transfers etc. but for ledger balance is what is available at the point of time. I'm thinking how should I form the query for the SQL statement. Currently, this is what I have. Transfer code = 2 -> future transferIF (@TransferCode = '2')BEGIN      --Insert into the account transaction table first--    INSERT INTO ACCOUNTTRANSACTIONS (AccountTransID, CustID, TransDate, TransType, Reference)    VALUES (@AccTransID,@CustID,@Date,@TransType,@Reference)        IF NOT (@Date = Getdate())        IF (@Withdraw > @BankBal)        BEGIN            INSERT INTO ACCOUNTTRANSITEM (AccountTransItemID, AccountTransID, AccNum, Withdraw, Deposit, status)            VALUES (@AccTransIte

View Complete Post

More Related Resource Links

Advise on calculation of measure of Balance sheet account

I am building a cube on top of Navision. The transaction table contains all transactions since the start with Navision (1 July 2003) on General Ledger Account level. For the Balance Sheet accounts, we have imported/inserted opening balance amounts. For the calculation of a trial balance of the Profit and Loss accounts I can just SUM the transactions for the period and it gives me the result for the period. For the balance sheet however, I can only calculate the net change for the period but not the ending balance for that period. Does SSAS have some kind of function to calculation the amount since the first date entry? (in my case 1 July 2003) For the P&L for example I created a calculated measure by using the YTD function that gives me the SUM for January untill August, even if I have selected only the month of August. It would be nice if SSAS had some kind of STD (start to date) function. Or do you advise that I have SSIS insert an opening balance on 1 January for each General balance sheet account (if I would find out how to do that ;-)

Balance Sheet for Stock

Hi All hear is My Table and Database   tblRecycle Date Ope.Balance Curent Purchase Current Sale Closing Bal 18/03/2010 1336.35 0 0 1336.35 19/03/2010 250.7 0 0 250.7 20/03/2010 130.35 0 0 130.35 21/03/2010 208.9 0 0 208.9 22/03/2010 256.95 0 0 256.95 23/03/2010 243.4 0 0 243.4 24/03/2010 203.45 0 0 203.45 25/03/2010 270.3 0 0 270.3 26/03/2010 370.25 0 0 370.25 27/03/2010 244.95 0 0 244.95 and hear is my Query   SELECT     tPurchased.RecyclingDateIn, ISNULL(oPurchased.Quant, 0) - ISNULL(tSold.Quant, 0) AS Balance, ISNULL(cPurchased.Quant, 0) AS QuantityPurchased,                       ISNULL(cSold.Quant, 0) AS QuantitySold, (ISNULL(oPurchased.Quant, 0) + ISNULL(cPurchased.Quant, 0)) - (ISNULL(tSold.Quant, 0) + ISNULL(cSold.Quant, 0))                       AS StockInHand FROM         (SELECT     RecyclingDateIn                        FROM          tblRecyclingGoods     &

WCF Router service - How to implement Load Balance



Do you know if is possible to implement a Load Balance using this WCF Router Service ?

I know that WCF Router Service has routing and backuplist feature. 

By the way, how does WCF Routr Service deal with services that have Callback Contract ?


Luis Filipe (from Brazil: Sorry about the English!)

Please help me with this challenge.... I need to figure this out bad. How do I calculate balance?


I have two tables that stores balance and transaction information about an account.

The first table stores all the transaction with transaction amount and effective date. The transaction has a code that differentiates deposit or withdrawal.

The other table stores balance but this balance is not historical. It is a rolling balance. It keeps on updating every time there is a transaction.

There is no place that stores the historical balance information after each transaction.

How do I calculate balance after each transaction in the history table using the current balance and the transaction code? Below is the example…

This is how the balance is stored


inventory cube balance


I am having problems with what is shown as "total" closing balance for a year when some weeks in that year are filtered out. I still see the value as of the end of the year, when I would expect to see the value of last visible week. My time dimension has a hierarchy [YW] which is [Fiscal Year], [Fiscal Week], [Calendar Date] and my balances are in [Measures].[Stk Units]. This is the formula I am using:

iif([T FISCAL CALENDAR].[YW].currentmember.level.name <>"Calendar Date",
[T FISCAL CALENDAR].[YW].currentmember.lastchild,
([T FISCAL CALENDAR].[YW].currentmember,[Stk Units]))

Please help

how do you balance admin and developer roles in managing security/audience and troubleshooting user


We're a 500-person services business, relatively new to SharePoint and recreating many legacy applications in SharePoint.  We have a couple developers and an administrator and have been trying very hard to segregate those roles.  The administrator controls Audiences, SharePoint groups, Distribution Lists, etc.  Developers have read access to Active Directory, but no rights to view or edit SP groups, Global Audiences, or Distribution Lists.   When user issues arise, the developer must always suspect a group membership problem but can't know enough to confirm or deny.

I would love to hear how others handle this.  Do your developers have admin rights? (And what problems does that cause?).  Do you have strict naming conventions to differentiate GA from SP from Dist List?  Do you have 3rd party tools to synchronize groups, so you can have perfect confidence that the Global Audience "Busboys" contains exactly the same users as the Active Directory group "Busboys?"  Is there a way for developers to have read-only access to the various groups so they can troubleshoot membership problems without endangering security?

TSQL cell balance from previous non null row table contains 20mill + rows so cursor not practical


I have a requirement to carry a running total forward in a table containing multiple periods and accounts, the table extract below shows an example

for row_num 5 the RunningTotal is -32.98, I would like to UPDATE the value of row_nums 6 through 9 to be -32.98 as they are at present NULL, the row_num 9 has a RunningTotal value of -32.69 I would like to UPDATE all preceding NULL values with -32.69 (10 through 13), the pattern being NULL value to be updated with populated value untill new populated value encountered 

I have set a field to be row_num using ROW_NUMBER () based upon TenancyNumber and WeeklyPeriod, a cursor is not practical in this instance as this table has rapid growth and presently has population of 20 mill + rows


rttdrtcw_id TenancyNumber WeeklyPeriod Tran_Year Tran_Week Receipt Debit Credit Adjustment row_num RunningTotal

18947           111                 200005        2000            5              -247.4   247.69 0     0            

Calculating Opening and closing balance for the month


Hi Team,


I need to  calculate the opening  and closing balance for the month  here is the scenario:-

I have a table call Delinquency  for the loan repayment defaulter’s which has an entry for proposalid , compute_date and ODPOS values. The table has proposal ID as its primary key and has an entry for every proposalid for only the last day of every month. April For eg:-







MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Content Query Web Part missing in SharePoint 2010

If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

sql query that don't run



I'm going crazy... i've got a piece of code that don't update the database... Could somebody tel me why it doesn't run??

Dim conn As SqlConnection
        Dim cmd As SqlCommand
        Dim cmdstring As String = "Update Corsi Set [Contenuto]='" & TxtText.Content & "' Where [ID]='" & Request.QueryString("Id").Replace("'", "") & "'"
        conn = New SqlConnection(SqlAnni.ConnectionString)
        cmd = New SqlCommand(cmdstring, conn)

Need help with a linq to sql query


I want to display some stats in a listview contril.  The table contains a record for every impression and for every click, and every record has a datetime field for the time and date of the impression of click.  I want to be able to display how many impressions and clicks there were in a given day and hour, something like below:

Date              Time                              Impressions    Clicks
8/20/2010                                               450              14            
                     Midnight -1:00am               150               5

How to send an email with information in query string


First I will say I googled (Binged to make Bill happy) for this but could not find anything, perhaps I am not stating what I need correctly;

I have a website that a customer creates orders (for a printing company) and after the order, I would like to email the customer a link to view the status of their order;

I need to send the CustomerID in the link so on the returning page if a CustomerID is detected in the querystring, I "auto login" the client and open the "Dashboard" for the order page for that customer.

Can anyone point me in the right direction as to how to send the link and how to parse the querystring to get the values from the link;

Thank you if you can point me in the right direction.

MDX Query parameter from SSRS


I've a MDX Query that has where clause as shown below.
I'm designing report using SSRS 2008. How can i pass date as parameter ? I tried to setup @from and @to as parameter but not working ?
any ideas....

WHERE ( {[Date Central].[Calendar Date].[2010-04-01 00:00:00]:[Date Central].[Calendar Date].[2010-08-30 00:00:00]} )

need it to work as
WHERE ( {[Date Central].[Calendar Date].[@From]:[Date Central].[Calendar Date].[@To]} )



Get ServerReport selected Parameter value to use in vb query


I'm using ReportViewer in Asp.net 2.0 to view a SSRS report. I need the value of the selected parameter to use in a vb query. The parameters are populated on the server and its a single selection. Doing searches I've come across  ReportViewer1.ServerReport.GetParameters() but I can't figure out if I can use this to determine which value the user has selected in the parameter dropdownlist. Any help would be appreciated.

Need Help in LINQ query for group By with chunks of record


I am assigning and unique id [strShipperIdSequence] on my List on bases of some properties which are grouped together uniquely.
Now what i needed is that my group should be further break down to some maximum amount of chunks.[Let say 10]
that mean's even i am having Same value in 12 records i should get 2 groups[I of 10 items and other of 2 items]

var uniqueGroups = objMdbContentInfoList.GroupBy(p => new
}).Select(g => g.First()).ToList();
foreach (var objUnique in uniqueGroups)
string strShipperIdSequence = APIGlobalMethods.GetShipperRequestID();
foreach (MdbContentInfo obj in objMdbContentInfoList.FindAll(h => (h.CON_ENTRY_POINT == objUnique.CON_ENTRY_POINT &&
h.APPTType == objUnique.APPTType &&
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend