Hi
Here is a query I have produced from a vehicle tracker database table. What I want to do is to calculate mileage of each journey over a time period based on the start and stop in the reason field. I have highlighted what I want in the calc field, so I know the mileage of each journey taken. Can anyone help I have no idea how the achieve this.
Thanks
Martin
Vehicle Time_Date Street Name Distance (mi) Reason Calc Fieldxxxxxx 06/05/14 17:08:20 0Ignition On xxxxxx 06/05/14 17:08:31 0Start xxxxxx 06/05/14 17:08:59 0.2Error report xxxxxx 06/05/14 17:09:54 0.2Time Send xxxxxx 06/05/14 17:10:54 0.5Time Send xxxxxx 06/05/14 17:38:57 0.4Time Send xxxxxx 06/05/14 17:39:23 0Ignition Off xxxxxx 06/05/14 17:39:23 0Stop 1.3 xxxxxx 06/05/14 17:39:23 0.1Acc. Summary xxxxxx 06/05/14 17:39:23 0Bus Ignition Off xxxxxx 06/05/14 17:50:35 0Wakeup xxxxxx 07/05/14 17:07:19 0Bus Ignition On xxxxxx 07/05/14 17:07:26 0Ignition On xxxxxx 07/05/14 17:07:27 0Start xxxxxx 07/05/14 17:08:05 0.2Error report xxxxxx 07/05/14 17:09:00 0.3Time Send xxxxxx 07/05/14 17:13:01 0.2Time Send xxxxxx 07/05/14 17:14:01 0.2Time Send xxxxxx 07/05/14 17:31:02 0.4Time Send xxxxxx 07/05/14 17:32:03 0.2Time Send xxxxxx 07/05/14 17:32:08 0Acc. Summary xxxxxx 07/05/14 17:32:08 0Stop 1.5 xxxxxx 07/05/14 17:32:08 0Bus Ignition Off xxxxxx 07/05/14 17:32:08 0Ignition Off xxxxxx 08/05/14 17:00:42 0Time Send