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 converted to time format

Status
Not open for further replies.

cm1234

Technical User
Oct 18, 2002
41
DK
I am running CR 9.0 and have a issue in getting a
number tabel converted to time format.
The string is made in MS sql and i need it to
be visual in CR as a time.
now it shows like 597 (a number)
and it schould be like 9:57(hh:mm)
Hope somebody can help me

best regards
cm1234
 
Are you quite sure you don't mean 957 that should be displayed as time(hh:mm)?

Could this work? Time then needs to be a string.

Code:
if length({your.time})=3 then 

left({your.time},1) & ":" & right(({your.time}),2)

else if length({your.time})=4 then 
left({your.time},2) & ":" & right(({your.time}),2)

\b
 
Hi acessn

No im sorry it dont work, but thankyou for
your quick reply on this matter.
It is 597 minuts stored as number and that gives
9 hours and 57 min., i just need to get it
converted.

best regards
cm1234
 
Try
Code:
ToText(Truncate(({mins}/60), 0)) & ":" & ToText(Remainder(({mins}/60)))

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi

Sorry that it toke me so long to answar you, but in a
little org. you must put many different caps on.
Im sorry but it doesnt work.

best regards
cm1234

 
Instead of saying that something doesn't work, you should explain why. Try the following:

ToText(Truncate({mins}/60),0,"") + ":" + ToText(Remainder({mins},60),0,"")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top