Change value in a column

Hi, I need your help.
I need to change the value 999999999 for xxx when the condition is meet
case
when U_Importacion != 'S' then price
[color=Yellow]when (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.25) then 999999999[/color]
when (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.5) then (round(T4.Avgprice * 1.05/1000,0)*1000)
when (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.6) then (price * 0.5)
when (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.7) then (price * 0.7)
when (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.8) then (price * 0.8)
when (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.9) then (price * 0.9)
else price
end

Comments

  • LlanthasLlanthas Cleveland, OH

    hard to tell exactly what you're trying to do, but you probably want to use something like:

    UPDATE (tablename)
    SET (fieldname) = '9999999999'
    WHERE U_Importacion != 'S' AND
    (
    (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.25)
    OR
    (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.5)
    OR (round(T4.Avgprice * 1.05/1000,0)*1000)
    OR (((datediff(day,getdate(), t1.expdate)/30.00) /U_Prometido) <= 0.6)
    )

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion