November 11, 2008 at 2:00 pm
I am displaying percentages as a column in the stored procedure output. Sometimes the percentage is showing as 128% or 155% which is wrong. But is there any function to dispaly that as 100% in case if we have more percentage(greater than 100).
Thanks.
November 11, 2008 at 2:05 pm
You can use a case statement
SELECT CASE WHEN Value > 100 THEN 100 ELSE Value END FROm SomeTable
Can you post the query? Maybe someone can see something wrong with the calculation that's resulting in the > 100% values.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 11, 2008 at 2:47 pm
Thanks.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply