Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    2

    Unanswered: Order by, excluding the first X characters

    Hi

    I have a column where records are either 6 or 7 characters long.

    for example:

    111.111

    OR

    111.01

    I am trying to order by the characters after the period. In other words I would like to exclude the first 4 characters (the 111.)

    Thank you in advance,
    Niko

  2. #2
    Join Date
    Jun 2012
    Posts
    2
    Answered my own question:

    order by substring(ColumnName, Charindex('.', ColumnName) + 1, LEN(ColumnName)-3)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •