Calculate 28 days of mileage

Ok.
I exported these to a new blank database.
Please find the attached. https://www.dropbox.com/s/0qgdhnarbuxsqvx/Mileage.accdb

You need to read. First about what type of file you need to attach. The second is how to attach. You could read the FAQs for that. The other and most important is to read up on Normalization.

A separate table for each vehicle is the basis of all basics. Could you imagine a Bank having a separate Table for each Account that they hold. There could be millions of them.

Best wishes on your rethink.
 
Ok.
I see what you mean. I fought with this thing all yesterday and think I made some leadway by comparing it to the db posted by RainLover.

I get readable data when I run the query, and it even starts out correctly as far as finiding the previous odometer reading and difference. (The totals are still off).

But something happens as it gets further along and the calculations are not correct. Im trying to look at it logically the reading through the expressions. Probably using something wrong. I have attached the query and table i am working on to a new DB and uploaded it to this site.

Thanks for your help so far
 

Attachments

Apologies for the delay in replying.

I have created a Database Query that may do as you require. This is attached for your consideration.

This method of using SQL is not overly easy. Especially when additional criteria are introduced or the Data type is different to any template you may have.

It would be my preference to create a Function in VBA.

Please see attached.
 

Attachments

FYI - I got this post. Have been in and out with the holidays and catching up. I will get to it as soon as I can. Thanks for the information and example. Ill let you know how I make out.
 
Awesome. I was looking through the queries. The one labeled "not by Rain" does not give me the correct running total. The other does. I see you are using two queries to make it work.

If you dont mind, I am going to use these two queries on my project. And change the hardcoded "185" criteria to where it can be chosen by the user on a new form.

Thanks for all your help and patience
 

Users who are viewing this thread

Back
Top Bottom