Most Late Personnel Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get the Most Late Worker Per Day But Below SQL I got only
those people who are late on the particular day. Is there any problem with
the SQL?

SELECT TimeCard.DateEntered, DriverInfo.DRIVER_ID, DriverInfo.DRIVERNAME,
DriverInfo.GRP, Max(TimeCard.LATE_HRS) AS MaxOfLATE_HRS
FROM DriverInfo INNER JOIN TimeCard ON DriverInfo.DRIVER_ID =
TimeCard.DriverID
GROUP BY TimeCard.DateEntered, DriverInfo.DRIVER_ID, DriverInfo.DRIVERNAME,
DriverInfo.GRP
HAVING (((Max(TimeCard.LATE_HRS)) Is Not Null And
(Max(TimeCard.LATE_HRS))>#12/30/1899#))
ORDER BY Max(TimeCard.LATE_HRS);
 
Hi,


Take a look at http://www.mvps.org/access/queries/qry0020.htm. Actually, as
it is, you get the MAXimum value of Late_hrs for each GROUP. Since the GROUP
is itself designed "by driver", the query would return the latest hour
entered, for each driver (and for each day, since the date is also used to
define the group).

Hoping it may help,
Vanderghast, Access MVP
 
Back
Top