i want to display only 1 record with the latest date and display the other columns
lastname firstname datestarted position salary
lian nez 2014-07-05 Cad Operator 4000
lian nez 2015-06-02 Foreman 10000
lian nez 2013-04-05 Manpower controller 13000
what i want is only this will be display because this is the latest record
lastname firstname datestarted position salary
lian nez 2015-06-02 Foreman 10000
The query is
SELECT s.lastname,s.firstname,LatestDate,s1.position,s1.salary
FROM constructiondb.dbo.employeetb s
JOIN
(
SELECT IDNo,position,salary,projectid, MAX(datestarted) AS LatestDate
FROM constructiondb.dbo.eassignmenttb
GROUP BY IDNo,position,salary,projectid
) s1 ON s.IDNo = s1.IDNo
INNER JOIN constructiondb.dbo.ProjectTB s2 on s2.ProjectNo=s1.projectid
where lastname='lian'and firstname='nez'