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!

Time Conversion

Status
Not open for further replies.

lissa1974

Technical User
Mar 2, 2006
26
GB
Hi there, I'm looking for a time conversion into HH:MM:SS from a field that outputs the date as...

72233 = meaning it's 07:22:33
104532 = 10:45:32
130427 = 13:04:27

Any help would be appriciated.

Regards

 
Have you tried a formula with Time({your.string})? Should work.

Failing that, you could use Left, Mid and Right to split the string and re-assemble it as a time. But it should not be necessary.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi there, sorry I'm running CR 2008. I've tried the Time {field}option but it just returns 0's. I guess it needs to be split out but not sure how to do that?
 
Try Time(ToNumber({your.string})). Otherwise split the hours, minutes and seconds, adjusting the split using Len which will say if the string is 5 or 6. Then re-assemble within a Time command. Your Crystal Help should give you the details

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi there, thanks a lot, nailed it in the end, thanks for your help
 
Glad you solved it - but it helps to say what you did. Someone else may have the same problem and look it up on this thread.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top