punctuation in between characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ddtpmyra
    Contributor
    • Jun 2008
    • 333

    punctuation in between characters

    I have address field and the data has puctuations like comma and periods. How can I update the data and delete the punctuation.

    I'm not sure if this works but I post here before commiting error.

    Code:
    update table_address set address ='% %' where address like '%.%'
    Last edited by NeoPa; Oct 26 '11, 12:57 AM. Reason: Added mandatory [CODE] tags for you
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32645

    #2
    I can only think of developing a User-Defined Function (udfStrip) that does the basic work for you and use it in an UPDATE query like :
    Code:
    UPDATE [Table_Address]
    SET    [Address] = udfStrip([Address])
    WHERE  ([Address] LIKE '%.%')
       OR  ([Address] LIKE '%,%')
    I tried to think of a way to use RegExes but couldn't find a way :-(

    Comment

    Working...