dbTalk Databases Forums  

Query for tracking fuel usage in fleet management

comp.database.ms-access comp.database.ms-access


Discuss Query for tracking fuel usage in fleet management in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
noname
 
Posts: n/a

Default Query for tracking fuel usage in fleet management - 01-28-2005 , 03:34 PM






Hello all, I use Access to keep track of approx. 80 vehicles.
I have a table of vehicles with specs.
I have another of service records linked to the vehicle table.
Works great! I can expand each vehicle to see what service I have performed
on just that vehicle.
I also have tables for billing categories, employees and departments.

So far so good.
Now I need to make it to where I can enter the fuel used by each vehicle
when someone fills it up.
I am having trouble figuring out how to total the amounts.
Do I need a table just for fuel entries, then a query to total it or what?

In the end what I would like is to have a form for entering the vehicle#,
amount, date, driver, mileage.
Then have it figure each month the miles driven, fuel used, and mpg.

Any help would be greatly appreciated.





Reply With Quote
  #2  
Old   
Ken Snell
 
Posts: n/a

Default Re: Query for tracking fuel usage in fleet management - 01-28-2005 , 03:54 PM






Yes, use a separate table for your fuel entries. As you note, you'll want
fields in that table that identify the vehicle (will be a foreign key back
to your vehicles table), the driver (probably a foreign key back to your
Drivers table), etc. Each record in the table will be a single refueling of
that vehicle.

Then you'll need to write queries to get the data you wish. You likely will
need to use a subquery if you want to "calculate" the miles driven since the
last refueling, where the subquery would return the mileage number from the
record whose date is the one most previous to the date of the current
(essentially, the Max date where the date is < the date of the current
record).
--

Ken Snell
<MS ACCESS MVP>




"noname" <nospam4meplease (AT) nospam (DOT) net> wrote

Quote:
Hello all, I use Access to keep track of approx. 80 vehicles.
I have a table of vehicles with specs.
I have another of service records linked to the vehicle table.
Works great! I can expand each vehicle to see what service I have
performed
on just that vehicle.
I also have tables for billing categories, employees and departments.

So far so good.
Now I need to make it to where I can enter the fuel used by each vehicle
when someone fills it up.
I am having trouble figuring out how to total the amounts.
Do I need a table just for fuel entries, then a query to total it or what?

In the end what I would like is to have a form for entering the vehicle#,
amount, date, driver, mileage.
Then have it figure each month the miles driven, fuel used, and mpg.

Any help would be greatly appreciated.







Reply With Quote
  #3  
Old   
noname
 
Posts: n/a

Default Re: Query for tracking fuel usage in fleet management - 01-28-2005 , 03:55 PM



Thanks Ken you are the man, I will get right on it.
I will post back and let you know the next roadblock I come to...lol.

"Ken Snell" <kthsneisllis9 (AT) ncoomcastt (DOT) renaetl> wrote

Quote:
Yes, use a separate table for your fuel entries. As you note, you'll want
fields in that table that identify the vehicle (will be a foreign key back
to your vehicles table), the driver (probably a foreign key back to your
Drivers table), etc. Each record in the table will be a single refueling
of
that vehicle.

Then you'll need to write queries to get the data you wish. You likely
will
need to use a subquery if you want to "calculate" the miles driven since
the
last refueling, where the subquery would return the mileage number from
the
record whose date is the one most previous to the date of the current
(essentially, the Max date where the date is < the date of the current
record).
--

Ken Snell
MS ACCESS MVP




"noname" <nospam4meplease (AT) nospam (DOT) net> wrote in message
news:FhyKd.18163$b07.14185 (AT) fe03 (DOT) lga...
Hello all, I use Access to keep track of approx. 80 vehicles.
I have a table of vehicles with specs.
I have another of service records linked to the vehicle table.
Works great! I can expand each vehicle to see what service I have
performed
on just that vehicle.
I also have tables for billing categories, employees and departments.

So far so good.
Now I need to make it to where I can enter the fuel used by each vehicle
when someone fills it up.
I am having trouble figuring out how to total the amounts.
Do I need a table just for fuel entries, then a query to total it or
what?

In the end what I would like is to have a form for entering the
vehicle#,
amount, date, driver, mileage.
Then have it figure each month the miles driven, fuel used, and mpg.

Any help would be greatly appreciated.









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.