Skip to Content
0
Former Member
Oct 29, 2015 at 04:42 PM

Query para costos maximo y costos minimo por rango de fechas

122 Views

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'