Please help!!! Replace characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sparkyboy2406
    New Member
    • Feb 2010
    • 1

    Please help!!! Replace characters

    Hi,

    Hopefully someone can help. I have a column in a table "mobile" that have values like
    -07841055223
    -07845254123

    etc.

    i need a query that will remove the "0" at the beginning and replace with "0044"

    any help is greatly appreciated.
  • gershwyn
    New Member
    • Feb 2010
    • 122

    #2
    This query would replace the first "0" with "0044":

    Code:
    Update [Mobile] Set [ColumnName] = "0044" & Right([ColumnName], Len([ColumnName]) - 1) Where [ColumnName] Like "0*"
    This is assuming you only need to do this update once. If you run the query multiple times, it's going to keep replacing the first "0". If this isn't what you need, please provide more detail on what values can be in that field and how they need to be managed.

    Comment

    Working...