fcobuzzi
asked on
How to subtract data in columns
Hi,
I would like to do the following operation.
Col A- Col B and then put result in Col C. All the columns are from the same table.
The values are numeric it would be something like this:
Col A - Col B = Col C
11 - 7 = 4
TIA,
Frank
I would like to do the following operation.
Col A- Col B and then put result in Col C. All the columns are from the same table.
The values are numeric it would be something like this:
Col A - Col B = Col C
11 - 7 = 4
TIA,
Frank
ASKER
I have already tried that here is the message that I get, maybe it will help.
Invalid operator for data type. Operator equals subtract, type equals varchar.
Frank
Invalid operator for data type. Operator equals subtract, type equals varchar.
Frank
This means that one of your columns (either ColA or ColB) is a varchar.
ASKER
All three columns are varchar.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the quick help.
UPDATE YourTable
SET ColC = ColA - ColB