SELECT EmpNumber, FirstName, LastName, ClockIn, ClockOut, IIf((DatePart(hour,ClockIn) Between 5 And 12) Or (DatePart(hour,clockin) Between 14 And 21),'Late','On Time') AS Status
FROM v_MES_TcActivities
GROUP BY EmpNumber, FirstName, LastName, ClockIn, ClockOut, IIf((DatePart(hour,clockin) Between 5 And 12) Or (DatePart(hour,clockin) Between 14 And 21),'Late','On Time'), CostCtr
HAVING (((ClockIn) Between Getdate()-30 And Getdate()) AND ((IIf((DatePart(hour,clockin) Between 5 And 12) Or (DatePart(hour,clockin) Between 14 And 21),'Late','On Time')) Like 'Late') AND ((CostCtr)='106330'))
ORDER BY LastName, ClockIn DESC
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
ASKER