Hello,
I am working on the query behind a report that deals with durations and costs. At the moment the durations are in hours only. I'm using these durations in hours to calculate labour costs, based on hourly rates. But I'd also like the durations to be displayed in hours and minutes. So I added a new field to my query which formats the durations in hours into hours and minutes. I used the following formula, where [Duration] refers to the duration in hours:
Int([Duration]) & ":" & Format(([Duration]-Int([Duration]))*60,"00")
I thought that this would work, and it does in almost every scenario in my data. Except where the duration is one hour exactly. Then a time of 0:60 is calculated, as Int(1) returns 0 and therefore 0 hours are displayed, along with (1 - 0) *60, to give 60 minutes. Is there another function that would work as Int (and Fix), but return 1 as 1?
Thank you,
Matthew
I am working on the query behind a report that deals with durations and costs. At the moment the durations are in hours only. I'm using these durations in hours to calculate labour costs, based on hourly rates. But I'd also like the durations to be displayed in hours and minutes. So I added a new field to my query which formats the durations in hours into hours and minutes. I used the following formula, where [Duration] refers to the duration in hours:
Int([Duration]) & ":" & Format(([Duration]-Int([Duration]))*60,"00")
I thought that this would work, and it does in almost every scenario in my data. Except where the duration is one hour exactly. Then a time of 0:60 is calculated, as Int(1) returns 0 and therefore 0 hours are displayed, along with (1 - 0) *60, to give 60 minutes. Is there another function that would work as Int (and Fix), but return 1 as 1?
Thank you,
Matthew