Reputation: 3
I am using SQL Server management studio. I have a column named salary. I want another computed column based on salary: (salary *20%+salary)/85
but I don't get the result.
I tried putting the formula in computed column specification tab under properties tab.
Upvotes: 0
Views: 152
Reputation: 247700
You should be able to use the following to calculate the value:
(salary * 1.2) / 85
See a SQL fiddle demo
Upvotes: 2
Reputation: 103358
That is an invalid SQL computation.
Instead of multiplying by percentage, divide by 100 and multiply by the percentage value:
(((salary/100)*20)+salary)/85
Upvotes: 2