R
ras
My table
ID - Autonumber Field
Patientid - This can have a number of records with the same number
dDate is the date of the record and can be duplicated.
I need to create a new table with the max of date for each unique
patient id.
So far not a problem.
SELECT TblCurrentEncounter.Patientid, Max(TblCurrentEncounter.dDate)
AS MaxOfdDate
FROM TblCurrentEncounter
GROUP BY TblCurrentEncounter.Patientid;
But the kicker is that i need the id of the row containing the max of
date.
As soon as i try to add ID to the query I get error about not being
part of the aggregate function.
Any ideas would be appreciated.
ID - Autonumber Field
Patientid - This can have a number of records with the same number
dDate is the date of the record and can be duplicated.
I need to create a new table with the max of date for each unique
patient id.
So far not a problem.
SELECT TblCurrentEncounter.Patientid, Max(TblCurrentEncounter.dDate)
AS MaxOfdDate
FROM TblCurrentEncounter
GROUP BY TblCurrentEncounter.Patientid;
But the kicker is that i need the id of the row containing the max of
date.
As soon as i try to add ID to the query I get error about not being
part of the aggregate function.
Any ideas would be appreciated.