Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compute Balance In Query
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01379592
Message ID:
01379608
Vues:
26
>>
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform