A
Arvi Laanemets
Hi
I'm designing a vehicle management database for my relative, and it looks
like I have hit a wall at moment.
I have a form where all route info (Routes table) is registered, like
DateTime, VehicleID, Mileage, etc. Also it's possible to link fueling info
form Expenses table (ExpenseID, ExpenseDate, ArticleID, Amount, Value) to
Routes table (Routes.Tanking-Expenses.ExpenseID)
Additionaly on form are some calculated fields which display speedometers
starting and end mileages, starting amount of fuel, tanked amount of fuel
and the cost of it, spended amount of fuel and end amount of fuel. Spended
amount of fuel depends on mileage, season (table SetUp: SummerStart,
WinterStart - both fields are dates), and on vehicles fuel spending
(liter/100km), which is read from vehicle registering table Vechicles:
VehicleID, ... , FuelInSummer, FuelInWinter, ...
Also there is a table, where some information about vehicle at some fixed
date is stored - Fix: FixID, VehicleID, FixDate, SpeedometerValue,
FuelAmount. Tis information is used as base data for all calculations.
Now, I need also to calculate the monetary value of fuel in tank at start of
route, and at end of it, and the value of spended fuel. The problem is, that
there can be fuel from several tankings in vechicles tank, and prices for
different tankings may differ. The rule must be, than always the oldest fuel
is used as first. But so long I don't have any cleatr idea, how to calculate
this. I'm even not sure, what is better: to calculate all, or to store some
calculated values in Routes table. Against latter speaks, that sometimes
routes may be entered later, or some information (mileage, tanking, monetary
value of tanked fuel, etc.) may be altered later - with storing calculated
values the recalculation of whole table is needed whenever some change is
made.
And at last, I foresee that I need to design some report(s), where also the
monetary value of spended fuel is needed.
Has someone designed something like this? Any ideas are welcome!
Thanks in advance!
Arvi Laanemets
I'm designing a vehicle management database for my relative, and it looks
like I have hit a wall at moment.
I have a form where all route info (Routes table) is registered, like
DateTime, VehicleID, Mileage, etc. Also it's possible to link fueling info
form Expenses table (ExpenseID, ExpenseDate, ArticleID, Amount, Value) to
Routes table (Routes.Tanking-Expenses.ExpenseID)
Additionaly on form are some calculated fields which display speedometers
starting and end mileages, starting amount of fuel, tanked amount of fuel
and the cost of it, spended amount of fuel and end amount of fuel. Spended
amount of fuel depends on mileage, season (table SetUp: SummerStart,
WinterStart - both fields are dates), and on vehicles fuel spending
(liter/100km), which is read from vehicle registering table Vechicles:
VehicleID, ... , FuelInSummer, FuelInWinter, ...
Also there is a table, where some information about vehicle at some fixed
date is stored - Fix: FixID, VehicleID, FixDate, SpeedometerValue,
FuelAmount. Tis information is used as base data for all calculations.
Now, I need also to calculate the monetary value of fuel in tank at start of
route, and at end of it, and the value of spended fuel. The problem is, that
there can be fuel from several tankings in vechicles tank, and prices for
different tankings may differ. The rule must be, than always the oldest fuel
is used as first. But so long I don't have any cleatr idea, how to calculate
this. I'm even not sure, what is better: to calculate all, or to store some
calculated values in Routes table. Against latter speaks, that sometimes
routes may be entered later, or some information (mileage, tanking, monetary
value of tanked fuel, etc.) may be altered later - with storing calculated
values the recalculation of whole table is needed whenever some change is
made.
And at last, I foresee that I need to design some report(s), where also the
monetary value of spended fuel is needed.
Has someone designed something like this? Any ideas are welcome!
Thanks in advance!
Arvi Laanemets