Hi,
Iam trying to retrieve the last record, based on date field (empanelDate) for each counselID from the table EmpanelmentTran.
Code:
SELECT EmpanelmentTran.counselID, Last(EmpanelmentTran.empanelDate) AS LastOfempanelDate
FROM EmpanelmentTran
GROUP BY EmpanelmentTran.counselID, EmpanelmentTran.empanelmentPurposeID;
The above code retrieves all the records not just the last record for each counselID

PS: I tried using MAX instead of LAST but with same result...