I have a table that includes an ID (key), TeamName, AccountType and DateChecked fields, amongst a few others.
What I would like to be able to do is return the latest entry for each distinct TeamName/AccountType combination. I've tried to follow the example here as shown below but get an error that "Specified field 'TeamName' could refer to more than one table listed in the FROM clause of your SQL statement."
Select TeamName, AccountType, ID
from Checks a inner join
(select TeamName, MAX(ID) as maxID
from checks group by TeamName) b
on a.TeamName=b.TeamName and a.ID=b.ID
I've tried switching ID and DateChecked within the query tna. I'm already way past my knowledge of Access/SQL and as always am trying to bastardise code where I can. Any help is gratefully received.