phone numbers

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

Guest

hey all,

i have a number field that contains a phone number.

some of my data has area codes and some don't.

can someone show me a way to attach area codes to the ones that need it. i
have some ideas of my own but i like to ask anyway.

thanks,
rodchar
 
rodchar,

I don't know about your area code problem, but I do know that phone numbers
should not be stored in numeric fields.

Things like phone numbers, social security numbers, etc are really character
strings, not numeric values.

Long term you will have nothing but problems storing these values in numeric
data types.

Kerry Moorman
 
I agree 100% only store fields as numeric values if you plan on
performing mathematical functions on them.
 
That being said

Dim newPhone as string

newPhone = CType(oldPhone, String)
if newPhone.length = 7 then
newPhone = "123" & newPhone
end if
oldPhone = CType(newPhone, Integer)
 
Your main problem will be knowing what area code to prepend to the
phone number. You will have to lookup the exchange by city and state
to find the area code. Some exchanges can be part of different area
codes too.
 
hey all,

i have a number field that contains a phone number.

some of my data has area codes and some don't.

can someone show me a way to attach area codes to the ones that need it. i
have some ideas of my own but i like to ask anyway.

thanks,
rodchar

You will need to have a area code database. On our dialer product, we
actually subscribe to a service that sends us area code updates... With
that, we are able to take the zipcode and look up the area code. This
way, numbers without area codes can still be dialed (most of the time :)
 

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

Back
Top