select CAST(DATEDIFF(mi,TimeIn, TimeOut)/60 AS varchar) + ':' + CAST(DATEDIFF(mi,TimeIn, TimeOut)%60 AS varchar) hours_and_minutes, [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 , MIN(PANELLOCALTZDT) TimeIn, MAX(PANELLOCALTZDT) TimeOut FROM [cCure].[dbo].[new_Pub_Journal] WHERE [cCure].[dbo].[new_Pub_Journal].PANELLOCALTZDT > '1/17/2010 23:59:59.000' AND [cCure].[dbo].[new_Pub_Journal].PANELLOCALTZDT < '1/19/2010' Group by CARDNUMBER ) T1 ON [cCure].[dbo].[employeeInformation].CCURECARDNUMBER = T1.CARDNUMBER WHERE [cCure].[dbo].[employeeInformation].Manager = 'Smith,Bob' AND [cCure].[dbo].[employeeInformation].Shift <> '3'
|