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!

Convert MM to DD:HH:MM

Status
Not open for further replies.

T1na

MIS
Oct 28, 2003
15
GB
I have got a time which displays in Mins (1590) but would like it to display Days, Hrs and Mins (1 Day, 2 hrs, 30 Mins). How do I change it?

Thanks
 
This is an adaptation of an faq by synapsevampire:

whileprintingrecords;
numberVar dur := {table.minutes};
numbervar days;
numberVar hrs;
numberVar min;
days:= Truncate(dur/60)/24);
hrs := Remainder(Truncate(dur/60),24);
min := Remainder(dur,60);

totext(days,0,"") + " Day"+(if days <> 1 then "s," else ", ")+
totext(hrs,"00") + " Hr"+(if hrs <> 1 then "s," else ", ")+
totext(min,"00")+ " Min"+(if min <> 1 then "s")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top