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!

Converting Decimal to Time 1

Status
Not open for further replies.

Krusher

IS-IT--Management
Jan 2, 2003
70
US
Folks,
How can I convert a decimal number to a time value in Crystal Reports 8.5 or 9.0

(Example: .75 to 1:15 or to 1.15)

Thanks in advance!

-K
 
you could use this formula to give the same answer as your example

int(0.75/0.6) + remainder(0.75,0.6)

but what is 0.75 ?

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Hi,

What you want to do is divide by 60. The whole number you get will be your hours and the remainder will be your
minutes.

Based on the example you provided, your formula could look like this:

numbervar x := .75;
numbervar hh := truncate(x * 100/ 60);
numbervar mm := remainder(x * 100,60);
totext(hh,0,"") + ":" + totext(mm,0,"")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top