Change data arround

R

Robert

I have a table with phone number that were imported in the
following format (212)-555-0440. The field is set to text,
with no input masks.

I need to convert the numbers into a number field sothey
are stored as follows: 2125550440.

How would I formulate an Update query to do this
conversion?

Thanks
 
E

Elwin

Base that field of your update query on an expression...

Expr1: Mid([ph#],2,3) & Mid([ph#],7,3) & Mid([ph#],11)
 
G

Gerald Stanley

Providing that the () and - characters are always in the
same place, the SQL should be along the lines of
UPDATE YourTable SET yourNumberColumn =
Mid(yourTextColumn,2,3) & Mid(yourTextColumn, 7,3) &
Right(yourTextColumn,4)

Hope This Helps
Gerald Stanley MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top