Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.
Function HrsWorkedAll(BegDate1, EndDate1) As Variant Dim conSQL As ADODB.Connection Dim strSQL As String Dim i As Integer Dim Total As Variant Dim rs As ADODB.Recordset Total = 0 i = 0 Set conSQL = New ADODB.Connection conSQL.Open "Server=THEDUB;DRIVER=SQL Server;Database=WRC;Password=*****;User ID=sales" strSQL = "Select Sum(TimeDiff(TimeClock.TimeIn, TimeClock.TimeOut) AS sum_units" & _ " WHERE DateValue(TimeClock.TimeIn) >= (" & BegDate1 & ")" & _ " AND DateValue(TimeClock.TimeOut) < (" & EndDate1 & ")" Set rs = New ADODB.Recordset rs.Open strSQL, conSQL, adOpenStatic, adLockOptimistic If Not rs.EOF Then HrsWorkedAll = rs.GetRows(-1, 1, "sum_units")(0, 0) Else HrsWorkedAll = 0 End If conSQL.Close
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|copy selected cell into new worksheet using checkbox||15||58|
|Excel VBA inserting a formula||12||39|
|how can I determine if an Excel spreadsheet will fit on an 8.5 by 11 inch sheet?||3||60|
|Pull data from a another spreadsheet tab||3||31|
Join the community of 500,000 technology professionals and ask your questions.