我正在查看车辆的 GPS 数据,由以下信息组成:
vehicle day ignition landmark
---------------------------------------------------
Sample Guy 1 7/5/2013 14:32 on
Sample Guy 1 7/5/2013 15:10 off Random Place B
Sample Guy 1 7/5/2013 15:15 on Random Place B
Sample Guy 1 7/5/2013 15:20 off
Sample Guy 1 7/20/2013 18:14 on
Sample Guy 1 7/20/2013 18:20 off Random Place H
Sample Guy 1 7/20/2013 18:22 on Random Place H
Sample Guy 1 7/20/2013 18:24 off
Sample Guy 2 8/1/2013 12:10 on Random Place ZZ
Sample Guy 2 8/1/2013 12:12 on
Sample Guy 2 8/1/2013 12:15 off Random Place ZY
Sample Guy 2 8/1/2013 13:10 on Random Place ZY
Sample Guy 2 8/1/2013 13:15 off
我试图找到地标为 Not Null 的第一个点火点,以及每天的地标为 Not Null的最后一个点火点。理想情况下,可以包含“持续时间”的计算字段以显示这两个值之间的 DateDiff。
目标输出:
vehicle day ignition landmark
---------------------------------------------------------
Sample Guy 1 7/5/2013 15:10 off Random Place B
Sample Guy 1 7/5/2013 15:15 on Random Place B
Sample Guy 1 7/20/2013 18:20 off Random Place H
Sample Guy 1 7/20/2013 18:22 on Random Place H
Sample Guy 2 8/1/2013 12:15 off Random Place ZY
Sample Guy 2 8/1/2013 13:10 on Random Place ZY
我知道这可能很复杂,但我希望开始了解完成此任务的构建块。感谢大家!