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

    Unanswered: How to replace char in Ntext field

    I need help on replace char in ntext data type

    Here is the example data
    <qMultipleChoice><qText>The%20AE%20understands%20w hat%20conditions%20the%2 0Account%20Manager%20is%20allowed%20to%20sign-off
    20on.</qText><qChoice>Strongly20Disagree</qChoice><qChoice>Disagree
    </qChoice><qChoice>Agree</qChoice><qChoice>Strongly%20Agree</qCh

    I want result look like this
    First Column:The AE Understands what conditions the Account Manager is allowed to sign-off.
    Second Column: Strongly Disagree Disagree Agree Strongly Agree

    This is what i had so far
    Select (SUBSTRING(QuestionText, (PATINDEX(N'%<qText>%', QuestionText) + 7),(PATINDEX(N'%</qText>%', QuestionText) - (PATINDEX(N'%<qText>%', QuestionText) + 7)))) From tblQuestion

    my result:
    The%20AE%20understands%20what%20conditions%20the%2 0Account%20Manager%20is%20allowed%20to%20sign-off%20on.

    I have problem with replace '%20' and how to make the second column.
    Any Help?
    Thanks
    Shan

  2. #2
    Join Date
    Jun 2006
    Posts
    2

    More

    If I do this
    (SUBSTRING(Replace(convert(nvarchar(4000), QuestionText), '%20', ' '),
    (PATINDEX(N'%<qText>%', QuestionText) + 7),
    (PATINDEX(N'%</qText>%', QuestionText) - (PATINDEX(N'%<qText>%', QuestionText) + 7))))as QuestionChoice

    then my result look like this
    The AE understands what conditions the Account Manager is allowed to sign-off on.</qText><qChoice>Strongl

    The first column still not right. Any input?

    Thanks for your time
    Shan

Posting Permissions

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