Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running totals in queries

Status
Not open for further replies.

PortyAL

Technical User
May 13, 2005
126
GB
Hi

Is there any way of showing a running total in a query? e.g.

Month Cost Total to date
April £1000 £1000
May £1500 £2500
June £950 £3450 etc.

Thanks

Alan Cassells
 
SELECT A.Month, A.Cost, Sum(B.Cost) AS [Total to date]
FROM yourTable A INNER JOIN yourTable B ON A.Month >= B.Month;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top