ABS de SQL
Publicado por Jesus (9 intervenciones) el 07/05/2005 18:04:56
Hola
Estoy usando SQL Server 2000 y no me funciona la siguiente instruccion
select ([Importe EA]/[Cantidad EA])-([Importe O.C.]/(Case when [Cantidad O.C.]=0 then 1 else [Cantidad O.C.] end)),
abs([Importe EA]/[Cantidad EA])-([Importe O.C.]/(Case when [Cantidad O.C.]=0 then 1 else [Cantidad O.C.] end))
from vCostosEAOC
Ponganle diferentes valores a cada campo y cuando el primer campo del select de negativo, el segundo deberia ser positivo, pero no sale así. ¿Que estará mal?
Estoy usando SQL Server 2000 y no me funciona la siguiente instruccion
select ([Importe EA]/[Cantidad EA])-([Importe O.C.]/(Case when [Cantidad O.C.]=0 then 1 else [Cantidad O.C.] end)),
abs([Importe EA]/[Cantidad EA])-([Importe O.C.]/(Case when [Cantidad O.C.]=0 then 1 else [Cantidad O.C.] end))
from vCostosEAOC
Ponganle diferentes valores a cada campo y cuando el primer campo del select de negativo, el segundo deberia ser positivo, pero no sale así. ¿Que estará mal?
Valora esta pregunta
0