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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate time

Status
Not open for further replies.

4656rp

Technical User
Feb 25, 2003
20
US
I have a couple a time fields (based on a 24 hour clock) in txt format that I need to calculate the difference. I have tried converting, using several date functions, using format(), and the only way I get it to work is padding records with len() < 4 with a leading 0. Is there an easier way?

Your ideas are greatly appreciated.

Many thanks

 
Right(txtField,2) + 60*Left(txtField,Len(txtField)-2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I'm sorry, I goofed. The time fields are numeric in 2400 clock. For instance,

timein timeout Exp Result(in minutes)

809 842 33
710 1527 497
1018 1103 44
950 1116 86
917 1008 51
 
I'm sorry, I goofed. The time fields are numeric in 2400 clock.

Nevermind, PH I figured it out. YOU ARE A GENIUS!

Many, many thanks [bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top