sql update question

Discussion in 'OT Technology' started by 2000GT, Nov 24, 2003.

  1. 2000GT

    2000GT Active Member

    Joined:
    Jan 21, 2001
    Messages:
    5,767
    Likes Received:
    6
    Location:
    Vancouver
    I have imported some new records into my sql db - however, I didn't realize that I forgot to remove some formatting before I imported them.

    How would I do the following:

    I imported a phone number field that looks like this:

    205,4446666

    when it should have been

    2054446666

    How would I create a statement that would update the field phonenum to remove the comma?

    Thanks
     
  2. picabu

    picabu I like pie

    Joined:
    Oct 4, 2001
    Messages:
    916
    Likes Received:
    0
    Location:
    Houston
    UPDATE table SET fieldname = REPLACE(fieldname,',','') I think would do it.

    Do SELECT REPLACE(fieldname,',','') FROM table first to see if it returns what you want.
     
  3. 2000GT

    2000GT Active Member

    Joined:
    Jan 21, 2001
    Messages:
    5,767
    Likes Received:
    6
    Location:
    Vancouver

    hmmm... its a no go... just sits there and times out?
     
  4. carlin

    carlin Guest

    how many records are u updating...???

    do it using a smaller quantity of records using the where clause....
     
  5. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    what is the database by the way?? SQL Server? Access? Oracle?
     

Share This Page