• CASE Rank WHEN 1 THEN 'Gold' WHEN 2 THEN 'Silver' ELSE 'Bronze' END AS RankColour

    So your after something like the above?

    IIF wont work in SQL as its not a SQL construct, its a coding language construct.

    If the above is not what you want please provide the tables, sample data and the expected outcome and I am sure we can get a resolution. You can take a look in the second link in my signature on the way to post the information so that we can make a quick testing environment based on what you provide.