D
Daniel Haro
Hi guys. I need some special help, please
I need to correct an expression (called TotalKilosDeduccion as mentioned
below in the SQL code). This expression needs to sum only the expressions
with a positive value in them.
Here is the SQL code for my query:
SELECT factores.Folio,
([factores.FactorHumedad]*[factores.PesoNetoProducto])/1000 AS
DeduccionHumedad,
([factores.FactorImpurezas]*[factores.PesoNetoProducto])/1000 AS
DeduccionImpurezas,
([factores.FactorHongos]*[factores.PesoNetoProducto])/1000 AS
DeduccionHongos,
([factores.FactorCalor]*[factores.PesoNetoProducto])/1000 AS DeduccionCalor,
([factores.FactorInsectos]*[factores.PesoNetoProducto])/1000 AS
DeduccionInsectos,
([factores.FactorAgentes]*[factores.PesoNetoProducto])/1000 AS
DeduccionAgentes,
([factores.FactorGerminados]*[factores.PesoNetoProducto])/1000 AS
DeduccionGerminados,
([factores.FactorPartidos]*[factores.PesoNetoProducto])/1000 AS
DeduccionPartidos,
([factores.FactorManchados]*[factores.PesoNetoProducto])/1000 AS
DeduccionManchados,
([factores.FactorAmpollados]*[factores.PesoNetoProducto])/1000 AS
DeduccionAmpollados,
([factores.FactorContrastantes]*[factores.PesoNetoProducto])/1000 AS
DeduccionContrastantes,
([factores.FactorAfines]*[factores.PesoNetoProducto])/1000 AS
DeduccionAfines,
[DeduccionHumedad]+[DeduccionImpurezas]+[DeduccionHongos]+[DeduccionCalor]+[DeduccionInsectos]+[DeduccionAgentes]+[DeduccionGerminados]+[DeduccionPartidos]+[DeduccionManchados]+[DeduccionAmpollados]+[DeduccionContrastantes]+[DeduccionAfines] AS TotalKilosDeduccion,
[pesonetoproducto]-[totalkilosdeduccion] AS PesoNetoAPagar, *
FROM Precio, factores;
I need to correct an expression (called TotalKilosDeduccion as mentioned
below in the SQL code). This expression needs to sum only the expressions
with a positive value in them.
Here is the SQL code for my query:
SELECT factores.Folio,
([factores.FactorHumedad]*[factores.PesoNetoProducto])/1000 AS
DeduccionHumedad,
([factores.FactorImpurezas]*[factores.PesoNetoProducto])/1000 AS
DeduccionImpurezas,
([factores.FactorHongos]*[factores.PesoNetoProducto])/1000 AS
DeduccionHongos,
([factores.FactorCalor]*[factores.PesoNetoProducto])/1000 AS DeduccionCalor,
([factores.FactorInsectos]*[factores.PesoNetoProducto])/1000 AS
DeduccionInsectos,
([factores.FactorAgentes]*[factores.PesoNetoProducto])/1000 AS
DeduccionAgentes,
([factores.FactorGerminados]*[factores.PesoNetoProducto])/1000 AS
DeduccionGerminados,
([factores.FactorPartidos]*[factores.PesoNetoProducto])/1000 AS
DeduccionPartidos,
([factores.FactorManchados]*[factores.PesoNetoProducto])/1000 AS
DeduccionManchados,
([factores.FactorAmpollados]*[factores.PesoNetoProducto])/1000 AS
DeduccionAmpollados,
([factores.FactorContrastantes]*[factores.PesoNetoProducto])/1000 AS
DeduccionContrastantes,
([factores.FactorAfines]*[factores.PesoNetoProducto])/1000 AS
DeduccionAfines,
[DeduccionHumedad]+[DeduccionImpurezas]+[DeduccionHongos]+[DeduccionCalor]+[DeduccionInsectos]+[DeduccionAgentes]+[DeduccionGerminados]+[DeduccionPartidos]+[DeduccionManchados]+[DeduccionAmpollados]+[DeduccionContrastantes]+[DeduccionAfines] AS TotalKilosDeduccion,
[pesonetoproducto]-[totalkilosdeduccion] AS PesoNetoAPagar, *
FROM Precio, factores;