I have a grid I need to make work. I need to limit the records to return only the most recent date for each record. Example data is:
1, 20, 2018-02-03, pass
2, 30, 2018-02-04, pass
3, 20, 2017-10-05, pass
4, 30, 2017-10-06, pass
5, 20, 2017-01-08, pass
6, 30, 2017-01-09, fail
7, 20 , 2016-08-17, pass
8, 21, 2016-06-06, pass
SQL
SELECT
pftID,
pfttrainID,
pftDate,
pftpass,
pftnotes
FROM
tbl_pft
I only want the grid to return the following lines.
1, 20, 2018-02-03, pass
2, 30, 2018-02-04, pass
8, 21, 2016-06-06, pass
I have tried using:
ORDER BY pftDate DESC
LIMIT 1
it gives me 1 result only
I am still having issues with sc macro and the best way to use them.
Thanks