Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6110 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have 8 fields, one is starting mileage and the others are ending mileage 1-7. I need to find the total miles driven on that trip however if I use this code:

Ending Odometer7 - Ending Odometer6 - Ending Odometer5 - Ending Odometer4 - Ending Odometer3 - Ending Odometer2 - Ending Odometer1 - Beginning Odometer
 I get some wacked out number IE: starting out with 157018 and ending odometer1 157066 and the rest 0, I get 314,084. Now if I place the code "Begining Odometer" in the front of the code I get, -48. So frustrated, I tried this code,


Beginning Odometer - Ending Odometer1 - Ending Odometer2 - Ending Odometer3 - Ending Odometer4 - Ending Odometer5 - Ending Odometer6 - Ending Odometer7

I still get "-48" but it should be "48". Now if you add say, 157100 to ending odometer2, it should say "82" but instead it says "157,148". If the fields are empty, it should not reference the field in the calculation, but it seems to be doing so. Any advice?

Posted

Hi Kevin,

I'm unsure why you have several 'like' fields holding the ending mileage. I would think the final ending mileage less beginning would give you total miles so I would assume there are things about your solution that we don't understand yet.

I would think that you want a running log instead of fields. In that situation, your ending miles from the first record would become the beginning of the second record and so forth. But if you want to know the mileage so far (and not all of the ending mileage fields have been filled in) then you could do something like:

[color:blue]Max ( Ending Odometer1 ; Ending Odometer2 ; Ending Odometer3 ; Ending Odometer4 ; Ending Odometer5 ; Ending Odometer6 ; Ending Odometer7 ) - Beginning Odometer

However, I still question your structure and wonder if there might be better ways of handling it which might make things easier for you overall. If you wish to explain more, maybe we can help with additional perspectives. :wink2:

LaRetta

Posted

Hi LaRetta, I just went to a portal to cover all the fields in 1 rather than having the fields seperate. Now with your code, it looks good. I was looking for a way to get rid of so many fields, so I made a portal to a mirrored table and it seems to be fine now. Thanks, "Max" worked well.

This topic is 6110 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.