Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time between depart on row 1 to arrive on row 2

Status
Not open for further replies.

kieso

Technical User
Jan 29, 2003
45
US
Golly! Thanks for the answer to my last question! I thought I’d push my luck a bit, and ask about a weird sort of running total problem.

Our database shows the arrive and depart times for each of the stops on each of our routes. We want to figure out the stop times for each customers, and the travel times to each customer from the last one.

Stop_#______Arrive Depart__stop min__travel min
# 0 start___________08:02_____________________
# 1_________09:30___09:40_____10_______88_____
# 2_________10:01___10:15_____14_______21_____
# 3_________10:46___10:58_____12_______31_____
# 4_________11:21___11:55_____34_______23_____
# 99 end____13:55_____________________120_____

It’s the last column that’s stumping me. How do I compare the depart time from row 1, to the arrive time on row 2, and then the depart time from row 2 to the arrive time on row 3?

Thanks again for any help you all may have

Rodger

P.S. I read an old post and saw how to change the sum of minutes to hh:mm:ss, so no need to explain that one :eek:)
 
The following will get the difference:

next({MyTable.ArriveTime})-{MyTable.DepartTime}

The functions NEXT() and PREVIOUS() are great for this sort of thing, they get the next or previous rows value which you can use to compare against a current rows value.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top