PDA

Ver la Versión Completa : Agregar Columna % utilidad


daniel072k
11/09/17, 19:12:31
Hola Buenas Tardes queria solicitarles ayuda, ya que deseo agregar una columna despues de 'precio venta1', que me muestre el porcentaje de utilidad de cada precio de venta, aplicando la formula P.Venta-P.Costo / P.venta* 100


SELECT T0.[ItemCode], T0.[Sww], T0.[ItemName], T0.[CodeBars], T0.[BuyUnitMsr], T0.[PurPackUn],T0.[LastPurPrc],T1.[OnHand], T1.[AvgPrice],T0.[QryGroup2],T0.[CardCode],
(select itm1.price from itm1 where T0.ItemCode=itm1.ItemCode and PriceList=1) as 'Precio Venta 1',
(select itm1.price from itm1 where T0.ItemCode=itm1.ItemCode and PriceList=2) as 'Precio Venta 2',
(select itm1.price from itm1 where T0.ItemCode=itm1.ItemCode and PriceList=3) as 'Precio Venta 3',
(select itm1.price from itm1 where T0.ItemCode=itm1.ItemCode and PriceList=4) as 'Precio Venta 4',
(select itm1.price from itm1 where T0.ItemCode=itm1.ItemCode and PriceList=5) as 'Precio Minimo',T1.[WhsCode]
, T2.[ItmsGrpNam] FROM OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITB T2 ON T0.ItmsGrpCod = T2.ItmsGrpCod WHERE T1.[WhsCode] =[%0] and T0.[Invntitem] = 'Y'


Agradeciendo su tiempo

Att..

daniel Molina