Re: My running sum didn't work
- From: "Baz" <bazz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 1 Jun 2007 14:59:58 +0100
You need a unique field returned by Query1 and by which the Query1 results
can be sorted in the correct order. Let's suppose that it is called
"sum_order". Then Query2 would look something like this:
SELECT Query1.Item, Query1.Description, Query1.FQty, DSum("FQty","Query1",
"Item & Description= '" & [Item] & [Description] & "' AND sum_order <= " &
Query1.sum_order) AS RunSum
FROM Query1
ORDER BY Query1.Item, Query1.Description;
However, it's an ugly query. I think I would add the running sum once the
data is in Excel.
"forcefield via AccessMonster.com" <u14819@uwe> wrote in message
news:730cb5d94e1e2@xxxxxx
Hi John,not
Thanks for the reply. Actually the data provided is only a sample as I do
want to complicate the problem. I intended to export a query consisting ofwhere
even more fields to Excel.
In other words, am I correct to say I need another unique field (on the
condition) for the query on running sum to work?is
Thanks
John Spencer wrote:
Without some field (or fields) to specify a unique order of records there
suchno way to do this in a query. Your data (as posted) does not have any
tofield. However, if you want a running sum on a report it is simple. Just
use your first query as the source for the report.
Add controls for Item, Description, and Qty and assign the fields to the
controls
Add another control and assign qty to it and set the Running Sum property
groupOVER GROUP
Select View: Sorting and Grouping from the menu
Enter Item as Field to sort by and set Group Header to Yes
Close the Sorting and grouping dialog
Set the group header height to zero or set the visible property of the
header to No
HI everyone[quoted text clipped - 31 lines]
Can someone please correct my running sum?
Thanks for your help
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200706/1
.
- Follow-Ups:
- Re: My running sum didn't work
- From: Baz
- Re: My running sum didn't work
- References:
- My running sum didn't work
- From: forcefield via AccessMonster.com
- Re: My running sum didn't work
- From: John Spencer
- Re: My running sum didn't work
- From: forcefield via AccessMonster.com
- My running sum didn't work
- Prev by Date: GROUP BY vs DISTINCT
- Next by Date: Re: Help overcoming NULL in a query
- Previous by thread: Re: My running sum didn't work
- Next by thread: Re: My running sum didn't work
- Index(es):