rs
SSCrazy
Points: 2819
More actions
April 23, 2004 at 9:18 am
#108284
I am trying to calculate percentage in select statement but i am getting wrong result, please help me.
How can get relult for the following
SELECT 6/141
equal to 4.26%
Thanks in advance,
kg_murthy
SSC Journeyman
Points: 86
April 23, 2004 at 9:25 am
#504026
Try this
SELECT cast(6/cast(141 as decimal) * 100 as decimal(5,2))
You need to convert on of the value to decimal to show the result in decimal format.
Thanks,
Murthy
April 23, 2004 at 9:38 am
#504032
Thanks Murthy it worked.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply