Running Subtraction (1 Viewer)

deanvilar

Registered User.
Local time
Today, 04:09
Joined
Mar 27, 2013
Messages
63
Hello Gurus ...

is there such a calculation in REPORT wherein I can have the Running Difference of several numbers?

Example is several Kilometer reading of a vehicle:

18716
18731
18742

difference of red color numbers: 15
difference of 2nd red color number and blue color numbers: 11

total: 26

**I don't even know if my calculation is correct ... HEEEELLLLPPPP!!!

thank you
 

plog

Banishment Pending
Local time
Today, 06:09
Joined
May 11, 2011
Messages
11,668
I don't think 'running' is the correct term to use here--mostly because you aren't doing it over a series of numbers, but just between 2 values (current and prior). Also, I don't believe there is something you can do in a report. But you can do it in a query that can be the source of the report.

You would create a calculated field using the DMAX(http://www.techonthenet.com/access/functions/domain/dmax.php) function. You would find the value of the record that is prior to the current one, and subtract that from the current records value. The real key is determining which record is the 'prior' one. For this you will need a field that orders your data. Perhaps its the field you are doing the difference on, perhaps its another.

Give it a shot and post back here. If you need help, post your table and field names along with some sample data.
 

deanvilar

Registered User.
Local time
Today, 04:09
Joined
Mar 27, 2013
Messages
63
thanks for the idea ... yep for sure "running" is not the right term .. but the concept is somethin like that i suppose.

I'll try using Dmax then if there's some positive result I'll surely post .. thanks
 

Users who are viewing this thread

Top Bottom