Converting decimal to [h]:mm in access

demyfrog

New member
Local time
Today, 13:09
Joined
Mar 1, 2012
Messages
1
I'm sure it will be simple but can somebody tell me how to show a decimal number in the Excel [h]:mm format.

I have a time sheet with start time / finish time in short time format. i then have a calculated field showing the diffference i.e. 08:35 I then total these 7 (days of the week) fields multiply by 24 which gives me the correct time but I cannot display it as 60:05

Any ideas?
 
Probably a bit late for your original query, however I have also been trying to resolve this issue and in the end came up with my own "fix". It may be of help to you...
In essence I take the decimal hours figure say 10.5 (10hrs 30min) and use the "fix" function to give me the 10 (i.e the integer value of the control); this gives me my "hours". I then subtract my hours integer from the original value which gives me all the numbers after the decimal point...bear with me...I then multiply this be 60 hence giving me the minutes portion. This "minutes portion" may not however be an integer so I use the "round" function to drop the decimals and round up (not entirely accurate if you are recording 100M sprint times). I suppose I could carry on on a similar way and change the minute decimals to seconds if I really wanted to. So the syntax for this is

=(Fix([DECIMALHOURS])) & " Hrs " & Round(([DECIMALHOURS]-(Fix([DECIMALHOURS])))*60,0) & " Min"

which you use as your control source for say [timehhmm] field. You could change the output format to HH:MM by changing the above code to...

=(Fix([DECIMALHOURS])) & " : " & Round(([DECIMALHOURS]-(Fix([DECIMALHOURS])))*60,0)
 

Users who are viewing this thread

Back
Top Bottom