Time calculated in Hours and Minutes

For HanDBase related topics that are not specific to one platform.

Time calculated in Hours and Minutes

Postby wilbrian » Fri Aug 07, 2009 3:22 pm

Is there a way to subtract two time fields (for an elapsed time) and have the results be in an "Hours and Minutes" format? When I subtract Start Time from End Time (and divide by 3600) I get a proper number of hours, but the minutes portion of the answer is a fraction of an hour instead of a number of minutes. Instead of a result of "2.75" (indicating 2 and three-quarters of an hour) I would like it to be "2:45" (indicating two hours and forty-five minutes).
wilbrian
 
Posts: 5
Joined: Tue Jun 16, 2009 8:32 am

Re: Time calculated in Hours and Minutes

Postby dhaupert » Fri Aug 07, 2009 3:28 pm

wilbrian wrote:Is there a way to subtract two time fields (for an elapsed time) and have the results be in an "Hours and Minutes" format? When I subtract Start Time from End Time (and divide by 3600) I get a proper number of hours, but the minutes portion of the answer is a fraction of an hour instead of a number of minutes. Instead of a result of "2.75" (indicating 2 and three-quarters of an hour) I would like it to be "2:45" (indicating two hours and forty-five minutes).


Great question. You can show the output as a time, but you have to put the output back into seconds again. So for example, you would multiply the result by 3600 to get seconds, and then select the output display to time format. It will show the duration at that point!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am


Return to HanDBase General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest