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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

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

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :Sql Server

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


View Complete Post

More Related Resource Links

Trying to figure out the code to calculate the circumference and area of a circle when the diameter


I'm trying to calculate the circumference and area of a circle when the diameter is entered by the user,I need the page to include a text box control to enter the diameter in, a button to post back the page and perform the necessary  calculations on its on_click event and two label controls to display the results,with them rounded to two decimal places,any help would be appreciated,I don't mind paying someone to help me figure this out,but I need it tonight.

Calculate distance, bearing and more between Latitude/Longitude points

This page presents a variety of calculations for latitude/longitude points, with the formulæ and code fragments for implementing them.

All these formulæ are for calculations on the basis of a spherical earth (ignoring ellipsoidal effects) - which is accurate enough* for most purposes. [In fact, the earth is very slightly ellipsoidal; using a spherical model gives errors typically up to 0.3% - see notes for further details].

How to calculate the distance between two points on the Earth

We offer many Global Database Products that you can use with the below formulas to calculate distances and many other uses. Not sure how to use distance calculations or global databases within your company? See our Global Database Examples for more information on how to use our data within your industry. Be sure to Download a Free Sample of one of our many Global Database Products.

Logic to calculate business hours


Hi All,

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.

I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.


Please help me guys... It will be a great help... 

Vrooooom: How .NET and C# Drove an Entry in the DARPA Grand Challenge


Find out how the .NET Framework, a team of programmers, and a bunch of people from Carnegie Mellon University built an automated car to compete in the DARPA Grand Challenge. Along the way you get some inside tips on building an extensible real-time control architecture based on a whiteboard metaphor and implementing an accurate GPS-synchronized timer component for .NET.

John Hind

MSDN Magazine December 2004

Calculate Client Height in javascript

The article Calculate Client Height in javascript was added by amoljk2009 on Monday, May 31, 2010.

Hi, Following code will help the developer to calculate exact client height in all browsers.script language="javascript" type="text/javascript">var winW = 630, winH = 460;if (parseInt(navigator.appVersion)>3) {if (navigator.appName

calculate fields in a list



how do I go about generating formulas for something like this.

I have a field( choice ) that has three choices (Low, Medium and High ). If I choose Low, I need to add 5 days to the current date( excluding weekends ) and place it in the Target date field, the same goes for Medium = 3 days( exclude weekends) , High = 1 day, exclude weekends.



KPI to calculate list item clicked most ?


Hello All:

Is there anyway where we can use KPI list to attach to a SharePoint list and indicates which item was clicked the most ? Or any other way to find out the best 5 links based on how many times they were accessed by a user?


Thanks in advance

SharePoint Developer

Need help with web.config security - Can't figure out where the security group is located in the ap



   We have sepeartate folder called Managers in one of our web apps. And there was a security build around that folder in a web config file as below

<?xml version="1.0"?>
        <allow roles="AllManagers"/>
        <deny users="*"/>

I couldn't figure out where this group located in the application. Usually all our groups are defined in Active directory but except this group. I am not sure if this is defined on the web server or some where in the app itself. Because in the process of figuring out I have changed it to <allow users="*"/> just to make sure if this is the group we are looking for and YES It is and I have access to it. So I need to find out where this is located and add myself as one of the users to this group.

Can any one help me with this mystery.

Thanks in advance,


Query challenge

I have a database table that conains the columns directoryPath, albumArtist, and albumTitle.  There are duplicates in the table.  I want to display the rows where the albumArtist and albumTitle are the same but the directoryPath is different.  Can you help me with the magic bullet query? Thanks in advance for any answers, Mark

Can not figure out LDAP naming convention for AD Application Mode login

I am trying to configure Oracle Access Manager (OAM) with AD application mode (ADAM). I am being prompted for the administrator (root DN) LDAP login for the ADAM instance, and nothing I try works. I know the administrator account in ADAM, and when I installed ADAM I used this info for the partition information, CN=accessmanager, DC=devnet, DC=local , the local admin account is devadmin, which is in the administrators container. My question is, what should the LDAP naming convention I should use for devadmin ? Oracle's example is (cn=administrator,o=company,c=us), but nothing I tried seems to allow OAM to access the ADAM installation. The obvious CN=devadmin,DC=devnet,DC=local does not work. Thanks in advance, John  

Performance Problems with calculate member in a cube

Hi,  I'm having performance issue with calculated member (Running total) which is created on one dimension in the cube.  Cube is having three dimension Product Details(Product Model, Product Type) , Time(Year & Month) & Qty type(In Qty & Out qty). See below for details Dimtime Year (Values 2000 to 2020) Month DimProd Product No Product Type Product Group DimQty Type In Qty Out Qty Fact Table Product No Year Month Qty Type of Qty( In Qty or Out Qty ) My MDX query for calculated member is  CREATE MEMBER [Qty Type].[Qty Type].[All].[Total] as      SUM(NULL:[TimeDim].[Hierarchy].CurrentMember , ([Qty Type].[Qty Type].[In Qty], Measures.[Qty]) - ([Qty Type].[Qty Type].[Out Qty], Measures.[Qty])  The formula is --> Total = Previous Period Total Qty + Inqty - Out Qty   This works perfectly when i browse at higher level (Qty Type on Rows & Time On Columns),   but when  i browse the cube adding dimension Product Details( Product group or Product Type) to Drill-through the In Qty & Out Qty,  the query is running and after one hour also it's not finished. Can anyone help me to solve this or propose new structure to resolve this issue.   

How to figure out if package runs in debug mode

Hi, I would like to know whether there is a possiblity to dynamically determine at runtime if a script is runing in debug mode or is being executed via SQL Server Agent? My goal is to prompt the user with some information e.g. initial catalog ensuring the package is being ran in the correct environment (development/production). However, as SQL Server Agent does not support MessageBoxes I would like to write some alternative code in this case. Thanks in advance!

how i can calculate date difference in oracle

how i can calculate the date diff in Oracle 10g using pl sql developer 7thank you

Two many to many dimension => How to calculate correct facts????

Hey guys,   I got a problem and I hope someone could help me with it.  I have the following scenario which I need to solve. The Schema looks something lilke that...   DIM3 DIM3_Key Dim3_Att   FactlessFact_DIM3_DIM4 DIM3_Key DIM4_Key WeightingFactor   DIM4 DIM4_Key Dim4_Att     FACT DIM1_Key DIM3_Key Sales_Fact   DIM1 DIM1_Key Dim1_Att   FactlessFact_DIM1_DIM2 DIM1_Key DIM2_Key WeightingFactor     DIM2 DIM2_Key Dim2_Att   As you can see my Facttable is connected to two dimension which are actually many to many. Also there is a 'WeightingFactor' in every FactlessFact table (BRIDGE), so that i am able to correct (as defined by the factors) values when ever I query DIM2_Att or DIM4_ATT.   So the Problem I have is that I every Fact shoud be MULTIPLIED with the WEIGHTING FACTOR. Well in MSAS 2008 I can do that with an Measured expression but since a measure needs to be unique I cannot just use 'WeightingFactor'. So When I renamed it to WeightingFactor34 and WeightingFactor12. But this only gives me the correct values for the defined Path. In case I use  WeightingFactor12 i only get the correct values for DIM2_ATT but not for DIM4_ATT.   I guess I need to solve this with a calculated Measure???? Am I right? I am new to MSAS and also new with MDX and all this stuff... How can use a calculated meas

MDX Calculation to calculate Rank

Hi all, I am trying to calculate rank of the objects based on sales. It should only change for date dimension. For all other dimension attributes, it should remain the same. Please help me out. Thanks, Sam  

Calculate variance based on property of account

Hi all, I'm having a problem implementing a requirement in SSAS. The case: There is a parent-child dimension Account which contains different accounts on which figures can be booked. This dimension has a unary operator. In this example I have three accounts: "Net interest income" and "Global operation allocations". These two accounts have the same parent "Net result". Besides the account dimension there is a scenario dimension which contains three scenarios: Actual, Budget and Variance. On every account can be indicated whether it is a "Expense Reporting" account. If this is the case the Variance is calculated by "Budget - Actual", otherwise this is calculated by "Actual - Budget". I implemented this by the following calculation script in the cube: -- Calculate Variance scenario SCOPE ([Scenario].[Scenario].[Variance]); SCOPE ([Account].[Expense Reporting].&[True]); THIS = [Scenario].[Scenario].[Budget] - [Scenario].[Scenario].[Actual]; END SCOPE; SCOPE ([Account].[Expense Reporting].&[False]); THIS = [Scenario].[Scenario].[Actual] - [Scenario].[Scenario].[Budget]; END SCOPE; END SCOPE; So far, so good: the variance is calculated correctly for the accounts on which the data is loaded: "Net interest income" and "Global operation allocations". However, on the account
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