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

Number to Time format in CR 8.5

Status
Not open for further replies.

mart1000

MIS
May 23, 2007
39
GB
I have a time as a number in a field unfortunately eg 150221 or 95022 and I need to convert to HH : MM : SS so on these example would like to show 15:02:21 and 9:50:22 (or maybe even 09:50:22 to look better?)

I am using CR 8.5

Many thanks
 
Please don't start multiple threads on the same topic--or crosspost the same thread in multiple forums. You should explain or show samples of how the number can vary. Is it always at least 5 digits so that we can assume there are always two digits representing minutes and seconds? If so, use a formula like this:

stringvar x := totext({table.number},"000000");
left(x,2)+":"+mid(x,3,2)+":"+right(x,2)

-LB
 
sorry, I know I posted something simelar last week but could not find original so had to post again. Newbie to this site and thought I would be able to search by my postings but dont seem able to do this?
As for examples I thought the above was enough, it will allways be in 5 or 6 digit format I show above, mins and secs allways 2 digits and hours either 1 or 2, Does your solution still stand?
If so I will try to see the results

Many thanks
 
Yes, it will work. To view your threads, go to the box in the upper left corner and click on "My Threads." To view all replies you have made to your own or other threads, click on "My Replies."

-LB
 
thanks I found the reply link after i posted my thanks to you!

Will try the solution you gave me

thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top