Removing hyphens from phone number field

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

Guest

Can anyone explain to me the most efficient way to remove the hyphens in a
list of phone numbers in my database? My current way of find and replace,
cannot be the best. Thanks.
 
You can use the Replace function

In the control source of the field in a report you can write

=Replace([FieldName],"-"."")
 
How about a Update Query to update all of the Phone numbers in the table to
numbers with no spaces.

******* UNTESTED *******

Update YourTable Set PhoneNum =
replace(replace(replace(replace(PhoneNum,"-","")," " ,""),")",""),"(","")
WHERE Not PhoneNum IsNull

******* END *******

PLEASE Perform this on a Copy of the Table in question.

What I think this query will do is to remove all of the -() and Space
characters out of the column PhoneNum in a table YourTable.
 
Back
Top