• declare @count int

    declare @charvaluefront varchar

    declare @charvalueback varchar

    declare @frontpos int

    declare @backpos int

    select @count=len('ABC')

    set @frontpos=1

    set @backpos=@count

    while(@frontpos<=@count)

    begin

    select @charvaluefront=substring('ABC',@frontpos,1)

    select @charvalueback=substring('abc',@backpos,1)

    print substring('abc',@backpos,1) + '**' + substring('ABC',@frontpos,1)

    set @frontpos=@frontpos+1

    set @backpos=@backpos-1

    IF LTRIM(RTRIM(@charvaluefront)) = LTRIM(RTRIM(@charvalueback))

    PRINT 'Got them its a palindrome. ' + LTRIM(RTRIM(@charvaluefront))+ ' ' + LTRIM(RTRIM(@charvalueback))

    end

    Results:

    c**A

    b**B

    Got them its a palindrome. B b

    a**C

    I would suggest that you post your actual code. The IF statement works as per sample above ....

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]