Milage Question

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
TandyServices
Posts: 15
Joined: 2015-12-07 22:59
Location: Largo, Florida
Contact:

Milage Question

Post by TandyServices » 2015-12-12 18:04

Hello all,
Have a question and if it can be done.
I have a field made up with Odometer Readings. Then another field made up for Mileage.
What I would like to see if can be done is take that columns odometer reading and subtract from the last odometer reading and auto post into the mileage field?

Thanks for any help I can get on this.

User avatar
TandyServices
Posts: 15
Joined: 2015-12-07 22:59
Location: Largo, Florida
Contact:

Re: Milage Question

Post by TandyServices » 2015-12-13 07:56

Here is a better lay to see if I can get help..
There are a few things I need to try and figure out. I have a table called report. The layout is below with how I would like to make it look. I would like to see if I can take the odometer reading and subtract from the last line and auto fill in at non_toll but if the member adds how many miles in tolls then the non_toll auto recalculates as below. As well as make the whole bottom line if possible.

+----+-------+-------------+-------+----------+
| id | state | odometer | tolls | non_toll |
+----+-------+-------------+-------+----------+
| 1 | TN | 209538 | 0 | 0 |
+----+-------+-------------+-------+----------+
| 2 | TN | 209929 | 0 | 391 |
+----+-------+-------------+-------+----------+
| 3 | AR | 210207 | 0 | 278 |
+----+-------+-------------+-------+----------+
| 4 | TX | 210820 | 13 | 600 |
+----+-------+-------------+-------+----------+
| 5 | NM | 211198 | 32 | 346 |
+----+-------+-------------+-------+----------+
| Total = | 1660 | 45 | 1615 | <--Need to figure out whole line and insert)

User avatar
TandyServices
Posts: 15
Joined: 2015-12-07 22:59
Location: Largo, Florida
Contact:

Re: Milage Question

Post by TandyServices » 2015-12-16 10:36

I figured out the adding totals on the bottom except for the odometer. Just had to check the show column sum.
How can I take the last odometer reading and subtract from the first odometer reading to make the total on the bottom? As well as take one odometer reading and subtract from the one above it and put that total into non_toll for each record. But if there is a toll in that record subtract that from non_toll as well?

Post Reply