|
Sql
Amigo este es el query que e desarrollado con tu ayuda pero me trae errores que me sale en la fila 5 y 24.
select
r.*,convert(char(10),GETDATE(),112) FechaActual,
(SelectDistinct T.UserID, T.UserName,CaseWhen h.fKey ='Entrada'then h.LogTime else 0 end)As Entrada,
CaseWhen h.fKey ='InicioAlmuerzo'then h.LogTime else 0 end)As Inicio,
CaseWhen h.fKey ='FinAlmuerzo'then h.LogTime else 0 end)As Fin,
CaseWhen h.fKey ='Salida'then h.LogTime else 0 end)As Salida
From History T
LeftJoin LogTime h on T.UserID = H.UserID
Where H. LogDate ='2011/05/17')
FROM
(SELECT [Cod_per]CodPersonal
,[ApePat_per]ApellidoPaterno
,[ApeMat_per]ApellidoMaterno
,[Nom_per] NombrePersonal
,[NomProy_per]Proyecto
,[NomArea_per]Area
,[NomCargo_per]Cargo
,[Estado_per]Estado
,[Cod_Finger]FingerID
FROM T_Personal
where [NomProy_per]='BMP'
and NomArea_per='sistemas'
and Estado_per='Activo')r;
|