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

Number to time formula. 1

Status
Not open for further replies.

bobpv

Instructor
Sep 3, 2002
107
US
Hi all,
I am racking the noggin trying to come up with the right formula, and seem to only draw blanks. Any advice please! I have data coming in as a number field, this is holding the process time in 10ths. So 1.5 is 90 min. I want to convert to Hours and min, or have it display as 1hr 30 min. I would also want .75 to display as 45 min.

I am stuck! Thanks for a hint!
 
This should work:

totext(truncate({yourtime.field}),0)+"hrs"+" "+ totext(val(mid(totext({@yourtime.field}),instr(totext({yourtime.field}),".")))*60,0,"") +"mins"

Please note that you said your data was in 10ths (e.g.,.5) an then provided an example that used hundredths (.75). This formula will work regardless.

-LB
 
SWEET!

I was missing the instr function. Thanks a million for the assist!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top