• SALIM ALI (6/18/2009)


    you could try this, it's a bit crude but works...

    declare @string varchar(50)

    SET @string = 'ABCDEFGHIJ123'

    select reverse ( substring ( reverse ( @string ) , 1 , 3 ) )

    Heh... Old post I know but I just have to ask... why would you do two relatively expensive "reverses" when RIGHT will do the job just fine? (I mean before this thread got "silly". )

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)