Topic: Convert Minutes to Hours and Minutes

Hello everyone,

I am trying to convert min to hours and minutes

For example
His Time              Her Time            Total Time
2hr 15min            1hr 30min           3hr 45min

Any help would be appreciated.  I have 'herhr' & 'hermin' and 'hishr' & 'hismin' fields in my db with at totaltime field as well.  I am just not sure how to put it all together.  I can get it to show 3.75, but not 3 45 much less 3hr 45min.

As always any help will be appreciated. 

Thanks

Sonny.

Re: Convert Minutes to Hours and Minutes

I think you need to use a calculated field. One thing to remember is you need to add '40' to any minutes over 60 to get the correct time.

Example 1:30 + 3:45 = 4:75 (decimal) you need to change it from base 10 to base 60 so the sum should be -


1:30 + 3:45 + 40 = 5:15 - in other words add the minutes up separately and then add any carry to the hour calculations.

Actually I'm rethinking my first comment, it might be better to perform that in a function - but others here might have a different view.

On a clear disk you can seek forever

3 (edited by derek 2020-04-19 14:15:54)

Re: Convert Minutes to Hours and Minutes

Hi Sdhale, CDB,
I guess it depends on how your data is actually being held.
If 'his times' and 'her times' are held as discrete records, then I'd do it by script.
If 'his times' and 'her times' are fields on the same record, then I'd use a calculated field.
See attached for the two options.
Regards,
Derek.

Post's attachments

Attachment icon adduptimes.zip 674.56 kb, 354 downloads since 2020-04-19 

Re: Convert Minutes to Hours and Minutes

derek wrote:

Hi Sdhale, CDB,
I guess it depends on how your data is actually being held.
If 'his times' and 'her times' are held as discrete records, then I'd do it by script.
If 'his times' and 'her times' are fields on the same record, then I'd use a calculated field.
See attached for the two options.
Regards,
Derek.

Derek, CDB,

Thank you both.  Derek this is perfect.  Thank you so much for the examples.  I tried a calculated field, but was unsure of the correct way of doing it.  I appreciate it very much.

Sonny.