Changing numbers

G

Guest

Hello in a field of a table (field name = tel1 tablename=Tbl1) there are
phone numbers inserted. Many numbers start with the digits 010... I need to
change that to 210... but 010 may also be in the rest of the phone-number not
just at the beginning. I don't want that to change, I just need 010 at the
beginning of the number to change. For example: 0102201056 should become
2102201056.
Not all numbers start with 010 but many do, and I just need to change those.
Can someone please help?
Thank you
Dimitris
 
J

John Spencer

An update query should do it.

UPDATE YourTable
SET [Telephone] = Replace([Telephone],"010","210",1,1,1)
WHERE [Telephone] Like "010*"

Note that you have to have at least Access 2000 SP2 or later for the replace
function to work in a query.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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