This should be the last thing I need help on with this blocktime database. I have 1.5 hours in a field. How would I convert that to 1:30 minutes
can someone help me out.
Thanks
Ken Devorak
Printable View
This should be the last thing I need help on with this blocktime database. I have 1.5 hours in a field. How would I convert that to 1:30 minutes
can someone help me out.
Thanks
Ken Devorak
Here's a simple function:
used:Code:Private Function DecToTime(DecValue As Single) As String
Dim Hour%, Min%
Hour = Left(Str$(DecValue), InStr(1, Str$(DecValue), ".", vbTextCompare))
Min = Val(Mid(Str$(DecValue), InStr(1, Str$(DecValue), ".", vbTextCompare))) * 60
DecToTime = Hour & ":" & IIf(Min < 10, "0" & Min, Min)
End Function
stTime = DecToTime(1.5)
It will return 1:30 - this also assumes that your decimal separator is a "." - if it's a "," then you need to make changes where necessary...
Good Luck!
Format(([sngl_time_fld] / 24), "h:mm") could also work.
Hi..
Try this:
X = 1.5
Y = Int((X-Int(X))* 60)
Good Luck.