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

convert decimal value to hh:mm:ss

Status
Not open for further replies.

mbryantuk

Programmer
Aug 3, 2007
29
GB
Hi

I have a field storing the amount of seconds to perform an action e.g. 20.25 seconds is it possible to convert this to HH:mm:ss in crystal

Thanks
 
use a formula

totext(int({secondsfield}/3600),0,"")&':'&
totext(int(remainder(({secondsfield}/3600),60)),0,"")&':'&
totext(int(remainder(remainder(({secondsfield}/3600),60),60)),0,"")

Ian
 
sorry that should have been

use a formula

totext(int({secondsfield}/3600),0,"")&':'&
totext(int(remainder(remainder({secondsfield},3600),60)),0,"")&':'&
totext(int(remainder(remainder(remainder({secondsfield},3600),60),60)),0,"")

Ian
 
I'll get it right in a minute

totext(int(10000/3600),"00",0,"")&':'&
totext(int(remainder(10000,3600)/60),"00",0,"")&':'&
totext(int(remainder(remainder(10000,3600),60)),"00",0,"")

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top