I have an Access table.
ID Field1 Field2 Date
1 un_1 x 201701
2 un_2 y 201704
3 un_1 z 201702
4 un_3 a 201703
5 un_2 b 201709
I would like to take the unique (for Field1) records of this table where Date is the most recent.
I tried:
SELECT ID, Field1, Field2, Date
FROM MYTABLE
WHERE Date=SELECT(MAX(MYTABLE.Date) FROM MYTABLE WHERE ID=MYTABLE.ID)
GROUP BY Field1;
But it is not working.
As result I would expect:
un_1 z 201702
un_2 b 201709
un_3 a 201703