Re: My running sum didn't work

Tech-Archive recommends: Fix windows errors by optimizing your registry



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,
Thanks for the reply. Actually the data provided is only a sample as I do
not
want to complicate the problem. I intended to export a query consisting of
even more fields to Excel.
In other words, am I correct to say I need another unique field (on the
where
condition) for the query on running sum to work?

Thanks



John Spencer wrote:
Without some field (or fields) to specify a unique order of records there
is
no way to do this in a query. Your data (as posted) does not have any
such
field. 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
to
OVER 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
group
header to No

HI everyone
Can someone please correct my running sum?
[quoted text clipped - 31 lines]

Thanks for your help

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200706/1



.