PDA

View Full Version : removing unwanted characters from phone number



ironj32
08-09-2007, 06:56 AM
i have a table which contains a bunch of phone #'s in this format:
800.123.4567

how do i remove the ".'s" from it...just want it to be 8001234567.

i know i have done this a long time ago in a query, i'm just having a brain fart. i was thinking a trim function or something like that? do i have to extract each group of numbers into seperate fields then combine them?

any advice is GREATLY appreciated!

Thanks

ironj32
08-09-2007, 08:04 AM
I'm trying this...but it's saying that "the wrong number of arguments are being used". Maybe someone could work off of this???

SELECT tblHezelInfo.VendorName, tblHezelInfo.ContactPhone,tblHezelInfo.ContactPhone( Left([ContactPhone],3), Mid([contactphone],5,7),Right([contactphone],9,12))
FROM tblHezelInfo;

qff
08-09-2007, 08:14 AM
Hi

you can use "replace" to remove the "."

e.g.
SELECT tblHezelInfo.VendorName, tblHezelInfo.ContactPhone,replace([tblHezelInfo.ContactPhone],".","") as newphone
FROM tblHezelInfo;

regards
qff

ironj32
08-09-2007, 08:17 AM
there we go! thanks a ton. i knew there was something like that.
Thanks!