I tried to do a calculation in SQL Server and to retrieved value with 2 decimal point. However, this is always return me the value in 0 for the 2 decimal point. Does anyone know what is going on there?
example:
select convert(decimal(5,2),((2*100)/19), 2) as 'test'
from customer
The return is always 10.00 instead of 10.53
Try changing one of the integers to a floating point number:
Result:
I picked 100 to change to 100.0 because I am guessing you are trying to calculate a percentage and that 100 will be a constant hardcoded in your final query. I am guessing that the other two values (2 and 19) will be later changed to read from integer fields in your table.