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

Time conversion and formatting. 2

Status
Not open for further replies.

fender78

MIS
Aug 11, 2002
13
US
I am trying to convert time which is in seconds to a hh:mm:ss format. I work on a davox dialer team and the time is exported in seconds through their reporting applications. I've made several attempts and am still unsuccessful.
I tried using a string quote, but not real good at those.
Thanks in advance. Jim
 
numberVar dur;
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

dur := {MyTable.MyDuration};

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00");

hhmmss

-k kai@informeddatadecisions.com
 
Thank you very much, I pasted your formula right in and it was amazing. Thanks again, Jim
A well deserved Star.
 
How would I go about summing the fields since their text objects now. Thanks, Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top