As start, it is a bad idea to import such info directly into table you are later working with. Currently you have a table which is refilled from csv-file. It's OK, and let it be so. But instead of working with this table, you create another table/tables. I advice tables, because the current table is not properly normalized.
You have a table (I don't see field names in your picture, so I have to make some names up)
tblCsv: DeviceID, DeviceType, Date1, Date2, Tester;
You need to create additional tables:
tblTesters: TesterID, TesterName;
tblDevices: DeviceID. DeviceType,...;
tblTests: TestID, DeviceID, TesterID, Date1, Date2 (I assumed Date1 and Date2 in your picture are linked to test. I hope at least one of tem is. In case another isn't, then it belongs probabli into tblDevices);
No, in procedure which imports data into tblCsv, you add code, which (after the import is done):
1. Updates the table tTesters with new names in field TesterName (It's best to have TesterID as autonumeric field);
2. Updates the table tblDevices with new devices (adds DeviceID and DeviceType for which there is not the same deviceID in tblDevices;
3. Updates the table tblTests with DeviceID, Date1, and Date2, and TesterID from tblTesters where TesterName is same as in tblCSV, wehere the combination of those 4 fields aren't present in tblTests;
4. Deletes all records from tblCsv.
So, you import csv-file, read imported info and distribute NEW info from it into 3 tables, and then you clear imported info, as it is not needed anymore.
Now about your query:
You have to create a saved query which calculates last test for every device. Like (I'm assuming Date1 is test date)
Code:
qLastTest = SELECT DeviceID, MAX(Date1) FROM tblTests GROUP BY DeviceID
And now you create a query for your report like:
Code:
SELECT test.DeviceID, dev.DeviceType, test.Date1, test.Date2, tester.TesterName
FROM (((tblTests test INNER JOIN qLastTest q ON q.DeviceID = test.DeviceID AND q.LastDate = test.Date1) LEFT JOIN tblDeviced dev ON dev.DeviceID = Test.DeviceID) LEFT JOIN tblTesters tester ON tester.TesterID = test.TesterID)