Hi All,
Im going to try to simplify this question as much as possible, but this one has me stumped.
I have 3 tables. A "Vehicles" Table, A "Vehicle Service Schedule" Table, and a "Loads Done By Vehicle" Table.
In the Loads Done Table, You select a vehicle, add the delivery address etc, and read in the start and end odometer reading.
The Service Schedule Table can have multiple entries per vehicle where you can specify the service type and amount of kilometers between each of the service types.
Now I need a query that pulls all vehicles that are due for the respective services specified in their schedule.
Firstly, I thought of running a query that groups the results by vehicle, then order the list so the latest record for each vehicle is first, then get that record for each vehicle. So now I have the latest vehicle load record, with their latest odometer reading. How am I going to query the records to get the ones that are due for a service. Bear in mind each vehicle can have multiple service types with varying kilometers between services.
Any help would be greatly appreciated. I am using Lightswitch, VB.NET with Visual Studio 2013.
Thanks in advance
Im going to try to simplify this question as much as possible, but this one has me stumped.
I have 3 tables. A "Vehicles" Table, A "Vehicle Service Schedule" Table, and a "Loads Done By Vehicle" Table.
In the Loads Done Table, You select a vehicle, add the delivery address etc, and read in the start and end odometer reading.
The Service Schedule Table can have multiple entries per vehicle where you can specify the service type and amount of kilometers between each of the service types.
Now I need a query that pulls all vehicles that are due for the respective services specified in their schedule.
Firstly, I thought of running a query that groups the results by vehicle, then order the list so the latest record for each vehicle is first, then get that record for each vehicle. So now I have the latest vehicle load record, with their latest odometer reading. How am I going to query the records to get the ones that are due for a service. Bear in mind each vehicle can have multiple service types with varying kilometers between services.
Any help would be greatly appreciated. I am using Lightswitch, VB.NET with Visual Studio 2013.
Thanks in advance