Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    162

    Unanswered: return text to chosen character

    how can i return text in a column up until a special character?

    I have this:
    abcd_1234
    abcdef_123456

    And i want this:
    abcd
    abcdef

    How can i return everthing thats left (or right) of the '_' character? i have tried use LEFT/RIGHT and SUBSTRING but i just cant make it to work.

    thx in advance //Mr

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    You need the CHARINDEX() function.

  3. #3
    Join Date
    Mar 2004
    Posts
    162
    works like a charm... thx alot.

    //Mr

Posting Permissions

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