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.
Function GetHrsOfOper(sResource As String, dDateIn As Date)
'SkipVought/2008 May 23/
'--------------------------------------------------
' Access: MS Access
'--------------------------------------------------
Dim sSQL As String
Dim rst As ADODB.Recordset, cnn As ADODB.Connection
Dim sPath As String, sDB As String
sPath = "\\bhdfwfp426.bh.com\M_Ctr$\1_Supply Chain\FP\Procedures\NewAdmin"
sDB = "APS UNIVERSE"
Set cnn = New ADODB.Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sPath & "\" & sDB & ".mdb;"
Set rst = New ADODB.Recordset
sSQL = "SELECT (1-TypeValue)*24 "
sSQL = sSQL & "FROM Resource_calendar_data "
sSQL = sSQL & "WHERE Resource Like '" & sResource & "%'"
sSQL = sSQL & " AND #" & Format(dDateIn, "mm/dd/yyyy") & "# >=FromDate"
sSQL = sSQL & " AND #" & Format(dDateIn, "mm/dd/yyyy") & "# <=ToDate"
With rst
.Open sSQL, cnn, adOpenStatic, adLockReadOnly, adCmdText
On Error Resume Next
.MoveFirst
If Err.Number = 0 Then
GetHrsOfOper = rst(0)
Else
GetHrsOfOper = 24
End If
.Close
End With
cnn.Close
Set rst = Nothing
Set cnn = Nothing
End Function