Link to home
Start Free TrialLog in
Avatar of Richard McLaurine
Richard McLaurineFlag for United States of America

asked on

Convert Time in Text Format to Numeric Time format

I have 2 tables where time is being stored as TEXT.  I need to convert this Text to a numeric value so that I can subtract the two fields from each other to determine out of service time.  The time format is 06:20PM (example) .  I am using Crystal Reports 11

Any help would be appreciated.  
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard McLaurine

ASKER

Thank you peter57r.  This did not work exactly but it did lead me to the answer.  When I tried to use datediff() it kept give me an error
datediff("h",{@Convert Avail},{@Convert SFT})
it would highlight {@Convert Avail} and tell me a date is required here.
But since you said it would convert to seconds which I was not aware of, I simply subtracted one from the other and then wrote a few simple conversions to get hours of service.
so i ended up with {@Convert Avail}-{@Convert SFT} and then converted seconds to hours & minutes
So thanks again for the help
Forced accept.

Computer101
EE Admin