views:

47

answers:

0

hi

i have to determine stopped time of an vehicle that send back to server its status data every 30 second and this data store in a table of database,
the fields of a status record consist of (vehicleID,RecieveDate,RecieveTime,Speed,Location).
now what i want to do is, determine each suspention time at the point that vehicle speed came to zero to the status the vehicle move again and so on for next suspention time, for example at a day may be have 10 stoped status and i must determine duration of each by a query.
the result can be like this
id Recvdate Rtime Duration
1 2010-05-01 8:30 45min
1 2110-05-01 12:21 3hour

please help me.