Fuel tracking in vehicle database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • noname

    #1

    Fuel tracking in vehicle database

    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.



  • Ken Snell

    #2
    Re: Fuel tracking in vehicle database

    see reply in comp.database.m s-access

    --

    Ken Snell
    <MS ACCESS MVP>

    "noname" <nospam4mepleas e@nospam.net> wrote in message
    news:liyKd.1816 4$ap7.14540@fe0 3.lga...[color=blue]
    > 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.
    >
    >
    >[/color]


    Comment

    • Ken Snell

      #3
      Re: Fuel tracking in vehicle database

      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" <nospam4mepleas e@nospam.net> wrote in message
      news:liyKd.1816 4$ap7.14540@fe0 3.lga...[color=blue]
      > 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.
      >
      >
      >[/color]


      Comment

      Working...