Add Area Code

  • Thread starter Thread starter LEVINE
  • Start date Start date
L

LEVINE

I have phone field that is a 7 digit number. I want to add a area code and
make the field a 10 digit number. Does anyone know in my update query what
string I should express to accomplish this.
 
Assuming you're trying to set them all to the same phone number, and your
existing phone number field can hold sufficient characters, it would be
something like

UPDATE MyTable SET PhoneNumber = "123" & [PhoneNumber]

On the other hand, you probably should put the area code in a separate
field, rather than concatenating them. I know it was certainly a lot easier
that way when we went from having 1 area code to 2 in my city.
 
I have phone field that is a 7 digit number. I want to add a area code and
make the field a 10 digit number. Does anyone know in my update query what
string I should express to accomplish this.

The Phone field should be of Text datatype, NOT number.

I'd suggest adding a Text field, 10 bytes long - or maybe longer, if
you will ever need to deal with international phone numbers (now's the
time to prepare for the future...).

If you want to have all the existing phone numbers default to the 313
area code, run an Update query updating NewPhone to

"313" & Format([Phone], "0000000")

John W. Vinson[MVP]
 
Back
Top