MountainMan1
Programmer
I am trying to create a feilds in a report that calculate time but access only sees time in a 24 hour format so I am having trouble getting hours to calculate past 24. If anyone can help please do.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT tblTaskTime.TaskTime, basTxt2Intgr([TaskTime],"hh") AS MyHr, basTxt2Intgr([TaskTime],"nn") AS MyMin, basTxt2Intgr([TaskTime],"ss") AS MySec
FROM tblTaskTime
WITH OWNERACCESS OPTION;
Public Function basTxt2Intgr(strTime As String, strPart As String) As Integer
Dim MyAry As Variant
MyAry = Split(strTime, ":")
Select Case strPart
Case Is = "hh"
basTxt2Intgr = MyAry(0)
Case Is = "nn"
basTxt2Intgr = MyAry(1)
Case Is = "ss"
basTxt2Intgr = MyAry(2)
End Select
End Function
Public Function basHrMinSec2StrTime(MyHrs As Long, MyMins As Long, MySecs As Long) As String
Dim lgSec As Integer
Dim lgMin As Long
Dim lgHr As Long
Dim lgCary As Long
lgSec = MySecs Mod 60
lgCary = Int((MySecs - (MySecs Mod 60)) / 60)
lgMin = (MyMins + lgCary)
lgCary = Int((lgMin - (lgMin Mod 60)) / 60)
lgMin = lgMin - (60 * lgCary)
lgHr = MyHrs + lgCary
basHrMinSec2StrTime = CStr(lgHr) & ":" & CStr(lgMin) & ":" & CStr(lgSec)
End Function