R
Richard Perry
OK, folks, I'm stumped on something. I'm putting together a vehicle service
database. For multiple vehicles, there are multiple service actions required
at various intervals.
What I've been working with is one table showing all service actions in the
fleet, recording which service was completed on which vehicle ID at a given
mileage and date.
What I need to see in the end is forecasting - when the next various actions
are due for a vehicle. I'm trying to do that by selecting the last actions of
each type for a vehicle from the table, add the period for each service (from
another table) to those numbers and reporting back.
It's the first part of this that's giving me fits at the moment - I'm NOT
very competent at SQL/programming this, and all my reference books on this
subject are in storage right now (long story). What I see at the moment is
that I can use the "max" function to select the latest action for a vehicle,
or the latest action (throughout the fleet) of a given type of service action
,but how do I get it to return the latest action of each type for a vehicle?
Is there an 'easy' way to do this that I'm missing? If I reorganized my
tables into seperate tables for each vehicle or each service action, would
this data be easier to mine?
database. For multiple vehicles, there are multiple service actions required
at various intervals.
What I've been working with is one table showing all service actions in the
fleet, recording which service was completed on which vehicle ID at a given
mileage and date.
What I need to see in the end is forecasting - when the next various actions
are due for a vehicle. I'm trying to do that by selecting the last actions of
each type for a vehicle from the table, add the period for each service (from
another table) to those numbers and reporting back.
It's the first part of this that's giving me fits at the moment - I'm NOT
very competent at SQL/programming this, and all my reference books on this
subject are in storage right now (long story). What I see at the moment is
that I can use the "max" function to select the latest action for a vehicle,
or the latest action (throughout the fleet) of a given type of service action
,but how do I get it to return the latest action of each type for a vehicle?
Is there an 'easy' way to do this that I'm missing? If I reorganized my
tables into seperate tables for each vehicle or each service action, would
this data be easier to mine?