moving range

anzacks

Registered User.
Local time
Tomorrow, 06:19
Joined
Mar 14, 2008
Messages
18
Hi all,

I'm new in this forum and can be considered as beginner in Ms Access. I tried to make a SPC database and currently stuck at calculating the data range for moving range graph.
The question is, how to calculate range between 2 consecutive data and then sum it.
For example:
A, 195
B, 198
C, 196
D, 194

Thus the range between A and B is 3 (198-195), B and C is 2 (198-196), C and D is 2 (396-194). The total range is 7 (3+2+2)

Anyone has the idea?

Thanks.
 
range

Have a look for posts on "running sum" and I believe there is an example in Roger Calstons web site.

Hi Uncle Gizmo,

Thanks for your advice. I went through some post about running sum, but so far I can't found something like I need.
I need a function that can calculate range before sum the result.

For example:
No, Data
A, 195
B, 198
C, 196
D, 194

I need a function that can create a column for range like below:
No, Data, Range
A, 195, 0
B, 198, 3
C, 196, 2
D, 194, 2

Thanks.
 
the only way to do this i would think is to iterate a recordset.

get your table or query and then write code similar to

myrst = currentdb.openrecordset("mytable")

while not myrst.eof
{process the item here
eg save details to compare with next one
do any calculations you need
etc}

myrst.movenext
wend
 
range

the only way to do this i would think is to iterate a recordset.

get your table or query and then write code similar to

myrst = currentdb.openrecordset("mytable")

while not myrst.eof
{process the item here
eg save details to compare with next one
do any calculations you need
etc}

myrst.movenext
wend

Thanks for the advice. I will try that.
 

Users who are viewing this thread

Back
Top Bottom