Mileage Query

S

schongresh

I am setting up a database that will take fuel log records and
calculate daily mileage, usage, gas mileage, etc. The record will have
Date-Truck#-Mileage(at time of fueling)-Amounts(Gallons)-Fuel Price.
In order to Query the database to find miles driven in a day for a
given truck- I need to get the Truck's previous days mileage to do the
math. What can I enter in the query design that will return the last
mileage entry and the one previous for the same truck? Or can a field
in the database automatically insert the previous recorded mileage for
a given truck to become "beginning mileage" and the current mileage
become "ending mileage". Either way I am not sure how to achieve this.
Any help would be appreciated.
 
K

KARL DEWEY

You use two instance of the same table in the query. When you do that Access
adds a sufix of '_1' to the table name. Join the two table on the TruckID.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top