
me he equipocado donde he puesto el Top 1.
Código SQL
[-]selectr.*,convert(char(10),GETDATE(),112) FechaActual ,
(select Top 1 [LogTime]from History as h
where [UserID]= r.FingerID AND [FKey]='Entrada'and [LogDate] ='2011/05/17') Entrada,
(select Top 1 [LogTime]from History as h
where [UserID]= r.FingerID AND [FKey]='InicioAlmuerzo'and [LogDate] ='2011/05/17') InicioAlmuerzo,
(select Top 1 [LogTime]from History as h
where [UserID]= r.FingerID AND [FKey]='FinAlmuerzo'and [LogDate] ='2011/05/17') FinAlmuerzo,
(select Top 1 [LogTime]from History as h
where [UserID]= r.FingerID AND [FKey]='Salida'and [LogDate] ='2011/05/17') Salida
FROM(SELECT [Cod_per]CodPersonal .....................................................
...........................................................
Saluditos