Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accumulative Balance
Message
 
 
À
14/10/2007 11:05:09
Issam Mansour
Jordan Business Machines
Amman, Jordanie
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01260902
Message ID:
01260906
Vues:
12
It's possible to do with a query but not very efficient. A subquery has to process all the records before current date for each date
SELECT Date, (SELECT SUM(mt2.Balance) FROM mytable mt2
                        WHERE mt2.date < mt.date ) AS RunningBalance
  FROM mytable mt
  GROUP BY Date
  ORDER BY Date
>
>How to calculate a accumulative balance in SP select statement to create running balance for an item. The data will be as following columns:-
>
>Date inQty Outqty ``Balance
>---------------------------------
>
>Best Regards
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform