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

Format time to show 2 places 1

Status
Not open for further replies.

szed

Programmer
Jun 25, 2003
55
US
CR10 Excel spreadsheet as the data source

I have a cross tab that I have the following code converting a time value to HH:MM:


NumberVar totalmins := ({'CIO_Data_'.MEAN} * 60);
NumberVar dys := totalmins \ 1440;
NumberVar hrs := (totalmins mod 1440)\ 60;
numbervar totalhours := hrs + (dys * 24);
NumberVar mins := totalmins mod 60;

totext(totalhours,00) + ":" + totext(mins,00);

However if there is a 0 it suppresses it and displays the following:

9:1 instead of 09:10

How can I force the 0's?? I've tried a couple of things and I know this should be easy but I'm stuck.
 
totext(totalhours,"00") + ":" + totext(mins,"00");

-LB
 
Thanks so much lbass!!! I knew it had to be simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top