Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Sorting working differently after moving from SQL Server 2008 to 2012 RE: Sorting working differently after moving from SQL Server 2008 to 2012

  • Kristen-173977 (10/9/2015)


    Assuming the "Please select" needs to be the first entry? then the ORDER BY needs to perhaps be:

    ORDER BY

    CASE WHEN EmpLogin = '-1' THEN 1 ELSE 2 END,

    AttorneyName

    Any even simpler approach is to change the first entry to '<Please Select>'. Angle brackets sort before alpha characters, and simultaneously draw attention to the fact that this in not a name.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA