Use an update query for Phone Number fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that has phone numbers stored in 1 of 2 formats.
(555)555-5555
(555) 555-5555

I have checked and the data is actually stored like this. I would like to
do an update query that puts the phone numbers in the format 5555555555 but i
haven't been able to achieve this.
Thanks in advance for the help.
 
One alternative is to use the Replace function to remove the unwanted
characters. For example:

UPDATE MyTable SET [PhoneNumber] =
Replace(Replace(Replace(Replace([PhoneNumber],"(",""),")",""),"
",""),"-","")

If you need to update only a portion of the phone numbers in the table, you
can add a WHERE clause to the above query.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I have a table that has phone numbers stored in 1 of 2 formats.
(555)555-5555
(555) 555-5555

I have checked and the data is actually stored like this. I would like to
do an update query that puts the phone numbers in the format 5555555555 but
i
haven't been able to achieve this.
Thanks in advance for the help.
 
Back
Top