Results 1 to 3 of 3

Thread: SQL 2000 Query

  1. #1
    Lounger
    Join Date
    Jul 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL 2000 Query

    I need to run a SQL query that would strip out some characters. I am using the Replace command, I can get it to work fine for replacing one character ie

    replace(narrdisp,',','') AS Narrative

    but I need to replace 2 different characters. Any idea what the syntax to do this is??

    TIA

    Lee

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL 2000 Query

    Try embedding the functions like this:

    replace(replace(narrdisp,CHAR(39),CHAR(34)),'%','* ') as Narrative

    First, the inner function replaces single quote (char(39)) with double (char(34)).
    Second, the outer function replaces percent ('%') with asterisk ('*').

    (The percent and asterisk are just examples - use whatever you need to replace.)

  3. #3
    Lounger
    Join Date
    Jul 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL 2000 Query

    Thanks, that works!!

Posting Permissions

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