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

Still not getting how to convert seconds to hours and minutes 2

Status
Not open for further replies.
Feb 6, 2004
7
US
I am a newbee with Crystal and can't figure how to convert the formula below to HH:MM

time(int({ERLOG.DTIME}/100),remainder({ERLOG.DTIME},100),0) -
time(int({ERLOG.ATIME}/100),remainder({ERLOG.ATIME},100),0)

I get out put of 10,200.00 what I want to see is:

2:50 or 2hr 50 min

Can anyone help?

Thanks
 
Please acknowledge if the suggested solutions here thread767-769529 didn't work before starting a new thread.

-dave
 
Here's the formula:

whileprintingrecords;
numbervar Dur := time(int({ERLOG.DTIME}/100),remainder({ERLOG.DTIME},100),0) -
time(int({ERLOG.ATIME}/100),remainder({ERLOG.ATIME},100),0);
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top