• Okay not the best question. However i wouldnt go as far to say it was nonsence. It shows that you cant mix different datatypes in a conditional order by without thinking about conversions.

    I do however dislike the

    WHEN @sortby = 'String1' THEN String2

    WHEN @sortby = 'String2' THEN String1

    part.

    Sorting by 'String1' and then using column String2 (and vice versa) doesnt really add anything. It makes you think that its a trick question. So its easy to focus on that part instead.

    So next time, no "trick" code to obscure what your trying to show ppl. Its really not needed.

    /T