PERCENTAGE

  • 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,

  • 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

  • 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