rounding

dmyoungsal

Registered User.
Local time
Today, 08:39
Joined
May 1, 2016
Messages
112
I have a form into which I enter the number of minutes I spend supporting my users.

On the report, I have a "total" field that I sum the time spent. Below is the formular I am using:
=Round((Sum([TimeSpent])/60),2)

Presently the result is showing 16.83 hours.

How can I best show the .83 in minutes?

Into my "TimeSpent" field I enter minutes (1 hour - 60; 1 hour and quarter - 75; etc)
 
Try:

=Int(Sum([TimeSpent])/60) & ":" & Format(Sum([TimeSpent]) Mod 60,"00")
 
Function FormatDecimalTime(DecimalTime As Single) As String
Dim lngHours As Long
Dim sngCalculated As Single

sngCalculated = DecimalTime / 24#
lngHours = Hour(sngCalculated) + _
24 * Int(sngCalculated)

FormatDecimalTime = Format(lngHours, "00") & ":" & _
Format(sngCalculated, "nn:ss")

End Function

Answer I found by Doug Steele, Microsoft Access MVP
I tried it and it told me in Hours, minutes, Seconds
FormatDecimalTime(16.83)
16.83 hrs = 16:49:48

at http://www.pcreview.co.uk/threads/converting-decimal-time-into-hh-nn-ss-time-in-access.2793160/

So use it something like:
FormatDecimalTime(Round((Sum([TimeSpent])/60),2))

Cheers!
Goh
 
Or maybe...
Code:
=TimeSerial(0, Sum([TimeSpent]) * 60, 0)
...and format the control for 24hr time.
 
how do I "thumbs up" the answers?

I do not see that option anywhere on the individual responses
 
i closed this question and the "thumbs up" is now present.
 

Users who are viewing this thread

Back
Top Bottom