>>
>>SELECT SUM(ISNULL(Deposit,0) + ISNULL(Payment,0)) AS Balance FROM Register GROUP BY Sequence ORDER BY Sequence
>>
>>Also it's not a good idea to use MONEY type.
>>
>>See
http://forums.asp.net/t/1380719.aspx>
>
>This is not returning the correct results. This returns the value of either column. I want to the balance after either the deposit or payment has been computed.
What exactly do you mean here? It should sum all payments and deposits for this sequence number.
If it's not broken, fix it until it is.
My Blog