zeeshanmbutt
Programmer
Hi all,
I have a Table T1 which has the following 2 fields:
Units (int type), CatUnits (int type)
T1 may has following records
Units, CatUnits
192237,2510116
242537,2947050
128112,2183856
Now I want to get the % Difference of Units Vs CatUnits, which I can achieve by the following formula:
(Units/CatUnits)*100
I would add this foruma as 'PercentDiff' in my following select statement:
select Units,CatUnits,((b.Totalunits/a.TotalUnits)*100)PercentDiff
from T1
192237,2510116,0
242537,2947050,0
128112,2183856,0
Why I am getting 0 here, that is i am getting only the integer part. How can i convert it into percent with one decimal?
Thanks a million in advance.....
I have a Table T1 which has the following 2 fields:
Units (int type), CatUnits (int type)
T1 may has following records
Units, CatUnits
192237,2510116
242537,2947050
128112,2183856
Now I want to get the % Difference of Units Vs CatUnits, which I can achieve by the following formula:
(Units/CatUnits)*100
I would add this foruma as 'PercentDiff' in my following select statement:
select Units,CatUnits,((b.Totalunits/a.TotalUnits)*100)PercentDiff
from T1
192237,2510116,0
242537,2947050,0
128112,2183856,0
Why I am getting 0 here, that is i am getting only the integer part. How can i convert it into percent with one decimal?
Thanks a million in advance.....