Running total from query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm building a database which will be used to monitor expenditure over
several site.
I'm having trouble finding a way to create a running total for each site. I
have one query which asks for user input to select a site, criteria = [Please
enter site Name]. This query works fine and displays all site matching the
criteria but i want to be able to display a running total of expenditure for
each site. Does anyone have any suggestions of how i can do this?

Hope this makes sense

Thank You

Dave
 
Thank You Jeff,

Is it possible to get the same output on a form?

Dave

Jeff Boyce said:
Dave

This is something quite simple if you use a report based on your query. Add
a textbox to the report, set the Running Sum property.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


Confused_Dave said:
Hi,

I'm building a database which will be used to monitor expenditure over
several site.
I'm having trouble finding a way to create a running total for each site. I
have one query which asks for user input to select a site, criteria = [Please
enter site Name]. This query works fine and displays all site matching the
criteria but i want to be able to display a running total of expenditure for
each site. Does anyone have any suggestions of how i can do this?

Hope this makes sense

Thank You

Dave
 
Since we don't know much about your tables and fields, open Northwind and
create a new query based on the Orders table. To get a running sum of Freight
by Customer, use this SQL:
SELECT Orders.CustomerID, Orders.OrderDate, Orders.Freight,
(SELECT Sum(Freight)
FROM Orders O
WHERE O.CustomerID = Orders.CustomerID and O.OrderDate<=Orders.OrderDate)
AS RunSumFreight
FROM Orders
ORDER BY Orders.CustomerID, Orders.OrderDate;

--
Duane Hookom
Microsoft Access MVP


Confused_Dave said:
Thank You Jeff,

Is it possible to get the same output on a form?

Dave

Jeff Boyce said:
Dave

This is something quite simple if you use a report based on your query. Add
a textbox to the report, set the Running Sum property.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


Confused_Dave said:
Hi,

I'm building a database which will be used to monitor expenditure over
several site.
I'm having trouble finding a way to create a running total for each site. I
have one query which asks for user input to select a site, criteria = [Please
enter site Name]. This query works fine and displays all site matching the
criteria but i want to be able to display a running total of expenditure for
each site. Does anyone have any suggestions of how i can do this?

Hope this makes sense

Thank You

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top