Tema: Query
Ver Mensaje Individual
  #8  
Antiguo 30-05-2011
abelg abelg is offline
Miembro
 
Registrado: jul 2004
Posts: 50
Reputación: 22
abelg Va por buen camino
Creo asi tendría que esta listo.

Código SQL [-]
select r.*,
           isnull((select Top 1 convert(varchar(30), [LogTime])
           from History as h 
           where [UserID]= r.FingerID AND [FKey]='Entrada'and [LogDate] ='2011/05/27'), 'No Digito Huella')  Entrada,
           isnull((select Top 1 convert(varchar(30), [LogTime])
           from History as h 
           where [UserID]= r.FingerID AND [FKey]='Salida'and [LogDate] ='2011/05/27'), 'No Digito Huella') Salida
FROM(SELECT [Cod_per] CodPers
,[Cod_Finger] FingerID
,[DNI_per] DNI
,[ApePat_per] ApellidoPaterno
,[ApeMat_per] ApellidoMaterno
,[Nom_per] NombrePersonal
--,[NomProy_per] Proyecto
--,[NomArea_per] Area
FROM T_Personal
where [NomProy_per] ='Nextel'---and NomArea_per = 'Comercial'
and Estado_per ='Activo')r
OrderBy r.ApellidoPaterno, r.ApellidoMaterno

Salu2
Responder Con Cita