Ok so i have a DECIMAL
field called "Score". (e.g 10.00
)
Now, in my SP, i want to increment/decrement the value of this field in update transactions.
So i might want to do this:
SET @NewScore = @CurrentScore + @Points
Where @Points
is the value im going to increment/decrement.
Now lets say @Points = 10.00
.
In a certain scenario, i want 10.00
to become -10.00
So the statement would be translated to:
SET @NewScore = @CurrentScore + -10.00
How can i do that?
I know its a strange question, but basically i want that statement to be dynamic, in that i dont want to have a different statement for incrementing/decrementing the value.
I just want something like this:
SET @Points = 10.00
IF @ActivityBeingPerformedIsFoo
BEGIN
-- SET @Points to be equivalent negative value, (e.g -10.00)
END
SET @NewScore = @CurrentScore + @Points