On 2016-05-10 12:03 AM, Cecil Westerhof wrote: > But it looks like that the following is also acceptable: > ? > CAST(ROUND(100.0 * rank / outOf + 0.4999999) AS int) AS percentage > and it is a lot simpler. So probably I will go for this.
That might seem simpler but on edge cases it would fail. Having an if-then version is more reliable in general. Also less ambiguous as ROUND doesn't behave the same everywhere. -- Darren Duncan