I have a field where I have a time value that is displayed in Seconds. I need to display it as HH:MM:SS. I've been looking and looking through the help text and the knowledge base on Crystal's site, and can't find anything...anyone know how to do this?
I found it! Here's the formula (from crystal's knowledge base...was buried in another function):
local numbervar RemainingSeconds;
local numbervar Hours ;
local numbervar Minutes;
local numbervar Seconds;
//divide the @TotalSeconds by 3600 to calculate hours. Use truncate to remove the decimal portion.
Hours := truncate({Agent_Skill_Group_Half_Hour.TalkInTimeToHalf} / 3600);
//
RemainingSeconds := {Agent_Skill_Group_Half_Hour.TalkInTimeToHalf} - (Hours * 3600);//subtract the hours portion to get //RemainingSeconds
//Divide RemainingSeconds by 60 to get minutes. Use truncate to remove the decimal portion.
Minutes := truncate(RemainingSeconds/60);
//subtract the Hours and Minutes and what is left over is seconds.
Seconds := {Agent_Skill_Group_Half_Hour.TalkInTimeToHalf} - (Hours * 3600) - (Minutes * 60);
//format the hours, minutes, and seconds to hh:mm:ss
totext(Hours,"00" + ":" + totext(Minutes,"00" + ":" + totext(Seconds,"00"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.