on 10-29-2015 4:42 PM
Buenos Dias gente,
realice el siguiente query para saber los costos maximos y costos minimo de mis productos por rango de fecha, pero no me da datos reales
si me podria ayudar se los agradeceria
SELECT DISTINCT T0.[ItemCode], T0.[Dscription],
(select Max (PDN1.StockSum/PDN1.Quantity) from PDN1 WHERE PDN1.Itemcode=T0.ItemCode) AS 'Maximo',
(select Min (PDN1.StockSum/PDN1.Quantity) from PDN1 WHERE PDN1.Itemcode=T0.ItemCode) AS 'Minimo'
FROM PDN1 T0 INNER JOIN OPDN T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.[DocDate] BETWEEN '[%0]' AND '[%1]'and t1.DocType='I'
Hola Cristiano.
prueba la siguiente Query, o adaptala según tu necesidad
SELECT
T0.ItemCode,
T0.Dscription,
MAX(T0.StockSum/NULLIF(T0.Quantity,0)) 'MAX',
MIN(T0.StockSum/NULLIF(T0.Quantity,0)) 'MIN'
FROM PDN1 T0 INNER JOIN OPDN T1 ON T0.DocEntry = T1.DocEntry
GROUP BY
T0.ItemCode,
T0.Dscription
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.