Ver Mensaje Individual
  #18  
Antiguo 05-07-2012
Karzie Karzie is offline
Registrado
NULL
 
Registrado: jun 2012
Posts: 5
Reputación: 0
Karzie Va por buen camino
Solución

Código SQL [-]
Esta Query te sacará de apuros:

select Id, Fecha, CostoPromedio  from Montos_Promedios tbl
where EXISTS(select ID,Max(Fecha) As Fecha from Montos_Promedios Group by ID HAVING ID = tbl.ID And Max(Fecha) = tbl.Fecha)
Order by ID

1    2012-06-09 00:00:00.000    9.00
2    2012-05-30 00:00:00.000    4.00
3    2012-05-30 00:00:00.000    7.00
4    2012-05-27 00:00:00.000    6.00
Responder Con Cita