substring replace question

  • I have a situation where I am working with legacy code.

    The issue involved involved a varChar field value that is being from ASP code.

    The varChar is the resultset of a Multiple SELECT box. All the items in the select are being passed as one string, but the string contains commas and single quotes. This is presenting a problem whem this value is used in a subquery, where only the value from the first item is being returned.

    EX: The multiple SELECT box contains ledger items.

    if 2 items are selected from the list, the value passed is

    'c:m:0603r:mn' ',' ' c:m:0703r:mn'

    how can I replace the section of code from

    ' ',' ' + space

    to

    ',' +remove the single space

     

    Thanks.

  • This was removed by the editor as SPAM

  • declare @STR as varchar(100)

    set @STR ='''c:m:0603r:mn '' '','' '' c:m:0703r:mn'''

    SELECT @STR , Replace(@str,''' '','' ''',''',''')


    * Noel

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

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