on 10-16-2014 3:25 PM
Necesito hacer un informe de toda la mercancía por fecha, donde necesito por línea la Cantidad Vendida agrupada Descripción del Articulo.
Hasta el momento lo que tengo es lo siguiente
SELECT T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity]
FROM OWTQ T0
INNER JOIN WTQ1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.[DocDate] =[%0]
GROUP BY T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity] ORDER BY T1.[Dscription]
Mi pregunta es como sumo un solo total de las Cantidades y que me las de por Descripción del Articulo
Gracias
ER
Hola Eric, coloca sum delante de cantidad, junto con el group by debe agruparte todas las lineas iguales
SELECT T0.[DocDate], T1.[ItemCode], T1.[Dscription], sum(T1.[Quantity])
FROM OWTQ T0
INNER JOIN WTQ1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.[DocDate] =[%0]
GROUP BY T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity] ORDER BY T1.[Dscription]
Saludos,
Arleen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.