Hi my query is quite simple to explain but I just can't seem to get the right answer.
I have a single table with 3 fields:
Estate Code (ID Field)
PLT PSM (Text Field)
Liaison TS (Date Field)
Each Estate Code can have several PLT PSM each with different timestamps. I want to report on the latest timestamp for each Estate Code with it's correspomding PLT PSM.
My efforts so far have been based around using a group by on the estate code and this works fine with just the date stamp, but as soon as i add the PLT PSM, i either get multiple returns (using Group by) or incorrect results (using another operator). Here is an example of my efforts so far (the problem here is the last operator on PLT PSM, but if i take that out then the query doesn't run):
Thanks for any advice
I have a single table with 3 fields:
Estate Code (ID Field)
PLT PSM (Text Field)
Liaison TS (Date Field)
Each Estate Code can have several PLT PSM each with different timestamps. I want to report on the latest timestamp for each Estate Code with it's correspomding PLT PSM.
My efforts so far have been based around using a group by on the estate code and this works fine with just the date stamp, but as soon as i add the PLT PSM, i either get multiple returns (using Group by) or incorrect results (using another operator). Here is an example of my efforts so far (the problem here is the last operator on PLT PSM, but if i take that out then the query doesn't run):
Code:
SELECT [Quick Estate - Liaison PSM Data].[Estate Code], Last([Quick Estate - Liaison PSM Data].[PLT PSM]) AS [LastOfPLT PSM], Max([Quick Estate - Liaison PSM Data].[Liaison TS]) AS [MaxOfLiaison TS]
FROM [Quick Estate - Liaison PSM Data]
GROUP BY [Quick Estate - Liaison PSM Data].[Estate Code];
Thanks for any advice