Hello,
I am running an update command on two columns in a table and have stumbled onto a problem. How can I subtract two fields from each other when the first field is a negative and the second a positive.
EX: -1200.02 – (+2200.02) = (-3400.04)
I cannot change the position of these fields otherwise I would make it:
EX: 2200.02 – 1200.02 = 1000
Here is the command I am using:
UPDATE My_Temp SET [Diff] = ((Cost) - (FYCost))
Does SQL have a function for this or will I have to create one?
Thanks,
Demopro
I am running an update command on two columns in a table and have stumbled onto a problem. How can I subtract two fields from each other when the first field is a negative and the second a positive.
EX: -1200.02 – (+2200.02) = (-3400.04)
I cannot change the position of these fields otherwise I would make it:
EX: 2200.02 – 1200.02 = 1000
Here is the command I am using:
UPDATE My_Temp SET [Diff] = ((Cost) - (FYCost))
Does SQL have a function for this or will I have to create one?
Thanks,
Demopro