I am using a case statement to order data on a SQL Server Reporting Services report. When the statement runs it returns the correct order, but when I save the Report Definition Language (RDL) and preview it, it returns to ascending order. How do I correct this?

    Requires Free Membership to View

It is a little hard to verify this without seeing the code. However, the typical rule of thumb is that if you do not explicitly order the results in a SQL query, then you are at the mercy of the database or API engine that is producing the results. Try explicitly adding an ORDER BY to your statement.

This was first published in September 2008

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.