Hi all,
I've been all over the web and have tried several ways to complete my query but cannot quite find the answer. What I need to do is pull the date from the LastAccessed field, then pull the row for each VPUserName that has the latest LastAccessed date. Here is my code:
Select a.VPUserName, d.FirstName, d.LastName, Employee, LastAccessed from RPUP a
left join RPRT b on a.ReportID = b.ReportID
left join DDUP c on a.VPUserName=c.VPUserName
left join HRRM d on c.Employee = d.HRRef
Left Join (select max(convert(VARCHAR(10),LastAccessed,120)) from RPUP Group by LastAccessed)
GROUP BY a.VPUserName, d.FirstName, d.LastName, Employee, LastAccessed
Order by a.VPUserName, LastAccessed DESC
Any suggestions?