Tema: Sql
Ver Mensaje Individual
  #23  
Antiguo 18-05-2011
Richard Lopez G Richard Lopez G is offline
Miembro
NULL
 
Registrado: may 2011
Posts: 32
Reputación: 0
Richard Lopez G cantidad desconocida en este momento
Sql

Estimada Caro.

Este es mi query que e desarrollado pero justo en el select anidado se me cae ya que cuando coapara y por desir el primer select en inicio se da cuenta que el usuario a marcado 2 veces es ahi donde se cae.

Dame una ayudadita sisisis.

select
r.*,convert(char(10),GETDATE(),112) FechaActual ,
(
select [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='Entrada'and [LogDate] ='2011/05/17')Entrada,
(
select [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='InicioAlmuerzo'and [LogDate] ='2011/05/17')InicioAlmuerzo,
(
select [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='FinAlmuerzo'and [LogDate] ='2011/05/17')FinAlmuerzo,
(
select [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='Salida'and [LogDate] ='2011/05/17')Salida
FROM
(SELECT [Cod_per]CodPersonal
,[ApePat_per]ApellidoPaterno
,[ApeMat_per]ApellidoMaterno
,[Nom_per] NombrePersonal
,[NomProy_per]Proyecto
,[NomArea_per]Area
,[Estado_per]Estado
,[Cod_Finger]FingerID
FROM T_Personal
where [NomProy_per]='BMP'
and NomArea_per='Sistemas'
and Estado_per='Activo')r;
Responder Con Cita