strSQL = "SELECT * FROM tblTimeSheetData WHERE [WorkDate] BETWEEN #" &
StartDate & "# AND #" & EndDate & "#" _
& "ORDER BY [EmpID], [WorkDate] ;"
Set rstTime = CurrentDb.OpenRecordset(strSQL)
Do While Not rstTime.EOF
rstTemp.AddNew
lngEmpID = rstTime![EmpID]
rstTemp![EmpID] = lngEmpID
intWeekday = Weekday(rstTime![WorkDate])
Select Case intWeekday
Case 2
rstTemp![MondayWorkDate] = rstTime![WorkDate]
rstTemp![MondayWorkHours] = rstTime![WorkHours]
Case 3
rstTemp![TuesdayWorkDate] = rstTime![WorkDate]
rstTemp![TuesdayWorkHours] = rstTime![WorkHours]
Case 4
rstTemp![WednesdayWorkDate] = rstTime![WorkDate]
rstTemp![WednesdayWorkHours] = rstTime![WorkHours]
Case 5
rstTemp![ThursdayWorkDate] = rstTime![WorkDate]
rstTemp![ThursdayWorkHours] = rstTime![WorkHours]
Case 6
rstTemp![FridayWorkDate] = rstTime![WorkDate]
rstTemp![FridayWorkHours] = rstTime![WorkHours]
End Select
rstTemp.Update
rstTime.MoveNext
Loop
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.