Ver Mensaje Individual
  #8 (permalink)  
Antiguo 21/10/2008, 11:53
Avatar de iislas
iislas
Colaborador
 
Fecha de Ingreso: julio-2007
Ubicación: Mexico, D.F.
Mensajes: 6.482
Antigüedad: 16 años, 10 meses
Puntos: 180
Respuesta: Algo Simple Pero...

Creo que te hace falta el SUM, ademas del IDArticulo

SELECT IDArticulo,
ALMA1 = SUM(SELECT OnHand FROM OITW WHERE WhsCode = 'DCKm11' and IDarticulo = Q.IdArticulo),
ALMA2 = SUM(SELECT OnHand FROM OITW WHERE WhsCode = 'Matriz' and IDarticulo = Q.IdArticulo),
ALMA3 = SUM(SELECT OnHand FROM OITW WHERE WhsCode = 'BLUM-CHI' and IDarticulo = Q.IdArticulo)
FROM OITW Q
GROUP BY IDArticulo