SQL Query

  • Hi,

         I Want to search a given string into another string, if it is available display its position. using sql query

    ex :

    materialcod

    sub001-001

    after the hyphen only i want

  • Hai,

    Use this

    select substring('sub001-001',charindex('-','sub001-001')+1,len('sub001-001'))

    If it is a column then use this

    select substring(materialcod,charindex('-',materialcod)+1,len(materialcod))

     

     


    Helen
    --------------------------------
    Are you a born again. He is Jehova Jirah unto me

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply