Running sum major problem

T

Ticotion

Hi

The material that the running sum is based on is not ordered as material; it
is a material number and not just a forthrunning number.
So if I understand you correct I need to have an autonumbering in my query
that tells access the order of the recordset. But this then generates a new
problem as I need to number the recordset. How can this then be done?

Ticotion
 
S

Stefan Hoffmann

hi,
The material that the running sum is based on is not ordered as material; it
is a material number and not just a forthrunning number.
So if I understand you correct I need to have an autonumbering in my query
that tells access the order of the recordset. But this then generates a new
problem as I need to number the recordset. How can this then be done?
If you need an artifical "autonumber" then the running sum makes no
sense. Think about it.

If you only need the running sum for a report, take a look at the
running sum property of a TextBox.

How to generate a running number in a query over an identity field:

SELECT (SELECT Count(*)
FROM [yourTable] I
WHERE I.ID <= O.ID) AS [AutoNumber],
O.*
FROM [yourTable] O

But still the same problem here: you need to order the recordset.


mfG
--> stefan <--
 
T

Ticotion

Hi Stefan

I work it out!.

I made a Temp table Where I put my data sorted på VolPct. Then I put in an
autonumber in the table and ran the runningsum on this.
I have then made a delete query and append query when I need to update data.
Doing it like this I always get a sorted recordset with an unique number.

Thank you for all your help

Ticotion
 

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

Top