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

Convert number to length of time 1

Status
Not open for further replies.

noslo

Programmer
Dec 10, 2001
24
0
0
US
Hello All,

I am using CR 8.

I am trying to convert a number to a length of time, hh:mm:ss. The field I am trying to convert measures the length of a phone call. I am having difficulty with the formula to use. Each formula I have looked at wants to convert the number to an actual time.


The field is Duration and display the data in 100's of a minute, not 60's of a minute. I need to convert it to hh:mm:ss

Examples:

1.1 would eaqual 1:06 in minutes and seconds
8.8 would equaly 8:46 in minutes and seconds

What formula can I use?

Thanks for the help.

Helen Tip: Never fry bacon without a shirt on.
 
ok...let's try this on

@DurationCalc

whileprintingrecords;
numbervar THours ;
numbervar TMins ;
numbervar TSecs ;
numbervar Temp := {Table.duration};

THours := truncate(Temp/60,0);
TMins := truncate(remainder(Temp,60),0);
TSecs := (Temp - truncate(Temp,0)) * 60;

totext(THours,"00") + ":" + totext(TMins,"00") + ":" + totext(TSecs,"00") ;

that should work Jim Broadbent
 
Jim,

Thank you so much!!! I appreciate the help. It worked wonderfully.

Helen Tip: Never fry bacon without a shirt on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top