Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accumulative Balance
Message
 
 
To
14/10/2007 11:05:09
Issam Mansour
Jordan Business Machines
Amman, Jordan
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01260902
Message ID:
01260906
Views:
11
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform