select
[cCure].[dbo].[employeeInformation].FirstName +' '+ [cCure].[dbo].[employeeInformation].LastName AS Employee,
TimeIn, TimeOut
FROM [cCure].[dbo].[employeeInformation]
INNER JOIN
(SELECT CONVERT(varchar, CARDNUMBER, 101) AS CARDNUMBER ,
MAX(PANELLOCALTZDT) TimeIn,
MAX(PANELLOCALTZDT) TimeOut
FROM [cCure].[dbo].[new_Pub_Journal]
WHERE [cCure].[dbo].[new_Pub_Journal].PANELLOCALTZDT > '1/4/2010 23:59:59.000'
AND [cCure].[dbo].[new_Pub_Journal].PANELLOCALTZDT < '1/6/2010' Group by CARDNUMBER ) T1
ON [cCure].[dbo].[employeeInformation].CCURECARDNUMBER = T1.CARDNUMBER
WHERE [cCure].[dbo].[employeeInformation].Manager = 'Smith,John' AND [cCure].[dbo].[employeeInformation].Shift LIKE '3'
|