I'm trying to group the data to me that they just want the last record of each ID, what should I do?
In access to solve my problem this way:
SELECT Table1.id, Last(Table1.status) AS LastStatus, Last(Table1.date) AS LastDate
FROM Table1
GROUP BY Tabele1.id;
My table
____________________________
| ID | STATUS | DATE |
|123456| 1 | 15/04/2016 |
|123456| 2 | 16/04/2016 |
|123456| 3 | 17/04/2016 |
|123456| 1 | 18/04/2016 |
|654321| 3 | 19/04/2016 |
|654321| 4 | 20/04/2016 |
|654321| 2 | 21/04/2016 |
|98765 | 3 | 22/04/2016 |
|98765 | 1 | 23/04/2016 |
|98765 | 2 | 24/04/2016 |
|98765 | 3 | 25/04/2016 |
------------------------------
The desired result is the last record of each ID.
____________________________
| ID | STATUS | DATE |
|123456| 1 | 18/04/2016 |
|654321| 2 | 21/04/2016 |
|98765 | 3 | 25/04/2016 |
------------------------------