Hi,
Iam trying to retrieve the last record, based on date field (empanelDate) for each counselID from the table EmpanelmentTran.
The above code retrieves all the records not just the last record for each counselIDCode:SELECT EmpanelmentTran.counselID, Last(EmpanelmentTran.empanelDate) AS LastOfempanelDate FROM EmpanelmentTran GROUP BY EmpanelmentTran.counselID, EmpanelmentTran.empanelmentPurposeID;
PS: I tried using MAX instead of LAST but with same result...