How to filter a table by values, then take most recently recorded of those values
I have the following code in SQL Server and it is not quite doing what I hope. I want to filter the Code table by the values, then output only the most recent. I can do it as 2 queries but ideally want to do it all in one but can’t quite work out how to piece it all together