Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    67

    Unanswered: Reg-x or something else...

    I have a table with a column of phone numbers like 999.999.9999 and 888-888-9999 and some 1-999-999-9999. I want to get rid of the dashes and dots and leave only the numbers. Is there a way to use reg-x in an SQL statement? If not is there another way to do this?

    We are using Sybase 11.9.

    Thanks in advance for your help!

  2. #2
    Join Date
    Jan 2003
    Posts
    67

    One solution....

    I worked this out, if I run it a few times I get the answer I need. Any way of improving this? I would think there would be a better way...

    UPDATE #attphtemp
    SET device_number=STUFF(device_number,patindex('%-%', device_number),1,NULL)
    WHERE patindex('%-%', device_number)>0

Posting Permissions

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