Tema: SQL-OrderBy
Ver Mensaje Individual
  #1  
Antiguo 25-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-OrderBy

Estimados tengo un problema no me permite utilizar el order by en esas sub consultas ayuda por favor, me sale este error

Msg 1033, Level 15, State 1, Line 19
La clusula ORDER BY no es vlida en vistas, funciones en lnea, tablas derivadas, subconsultas ni expresiones de tabla comn, salvo que se especifique tambin TOP o FOR XML.

Ayuda Urgente

select r.*,(selectTop 1 [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='Entrada'and [LogDate] ='2011/05/24')Entrada,(selectTop 1 [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='InicioAlmuerzo'and [LogDate] ='2011/05/24')InicioAlmuerzo,(selectTop 1 [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='FinAlmuerzo'and [LogDate] ='2011/05/24')FinAlmuerzo,(selectTop 1 [LogTime]from History as h where [UserID]= r.FingerID AND [FKey]='Salida'and [LogDate] ='2011/05/24')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] ='Nextel'---and NomArea_per = 'Sistemas'
and Estado_per ='Activo')r;

Última edición por Casimiro Noteví fecha: 25-05-2011 a las 18:31:50.
Responder Con Cita