I have 2 tables that I'm joining; I want all rows from employee table to retrieve latest time for a date in transactions table; the transaction table can have multiple records for employee on same date. Right now, cannot find way to limit transactions to last record (latest time entry)
This is an access table; Adodb query from excel to access.
SELECT E.ID, E.Employee, E.lastname, T.in, T.out, T.date, T.type, T.EmployeeID FROM employee E RIGHT JOIN transactions T ON E.ID = INT(T.EmployeeID) WHERE " & _
"T.date = #" & Format(yesterdate, "Short Date") & "# AND T.type = 'JobCode5' AND E.location = 'EastBuilding' AND E.ID = 89 AND E.stat = TRUE
I expect to get 1 transaction per applicable employee; preferably the transaction with the latest time on given date.