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

Minutes returning as percentage of an hour

Status
Not open for further replies.

Kevinski

Technical User
Jan 4, 2001
95
NZ
Hi

Crystal 8.5

I am querying a database where there is a field which captures the time spent on a service call.

Where, in the database, this is say 2hours 30 minutes, when returned to Crystal this comes back as 2.50

How can I convert any fraction of an hour to minutes rather than a percentage of the hour?

I've tried the formula

if {Service_Engineer_Trans.se_actual_hours} <1
then {Service_Engineer_Trans.se_actual_hours}*.6
else {Service_Engineer_Trans.se_actual_hours}

and this seems to work ok although a time of 1hr 30 minutes still comes back as 1.50

Any other suggestions? The hours are always correct but not the minutes......
 
You should state an exmple of what's actually stored in the database, Crystal isn't altering what's stored, you're probably accustomed to another application which is doing the conversion.

Try:

(remainder({table.field},int({table.field})))*60

This will return the minutes, though I suspect that you want the hours and minutes displayed:

totext(int({table.field}),0,&quot;&quot;)+&quot; hours and &quot;+ totext( (remainder({table.field},int({table.field})))*60,0,&quot;&quot;)+ &quot; minutes&quot;

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top