Newbies Rocktour Posted June 4, 2005 Newbies Posted June 4, 2005 I am trying to automatically figure miles per gallon. I have several records (state line crossings) of which some contain fuel purchases for that state. I have created a trailing grand summary part which contains totals of fuel purchased (gallons, etc) which works fine. I have also created a total miles field which is a calculation of the EndingMileage-StartingMileage fields. The AverageMPG field contains a calculation of TotalGallons/TotalMiles which also works fine. Here is the problem. If I enter a fuel purchase in the first record only, it places the correct MPG in the AverageMPG field. If I do not enter a purchase in the first record but enter purchases in other records it enters a ? in the field. If I enter a purchase in the first record and also other records, it enters the AverageMPG as if the first record was the only fuel purchased thereby ignoring the other fuel purchases. Fields... TotalMiles Calculation EndingMileage-BeginningMileage TotalGallons Summary =Total of FuelGallons (running) AverageMPG Calculation Unstored =TotalMiles/TotalGallons Thanks in advance for the help, Charlie
-Queue- Posted June 7, 2005 Posted June 7, 2005 I think there may be some confusion here in the combining of calculation fields with summary fields. The TotalMiles calculation operates on each record individually, while the TotalGallons summary includes all records in the found set (or subsummary part). Therefore, the AverageMPG calculation is the current record's mileage divided by the running total of FuelGallons for the found set (or subsummary, when in Preview Mode). I think what you need is another summary field called Total of TotalMiles, defined to be a running total of the TotalMiles calculation. Use this in your AverageMPG calculation, instead of TotalMiles.
Recommended Posts
This topic is 7177 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 accountSign in
Already have an account? Sign in here.
Sign In Now