473,473 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

phone numbers

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
Nov 21 '05 #1
7 1421
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
"rodchar" wrote:
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

Nov 21 '05 #2
I agree 100% only store fields as numeric values if you plan on
performing mathematical functions on them.

Nov 21 '05 #3
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)

Nov 21 '05 #4
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.

Nov 21 '05 #5
Here's some additional inforamtion regarding Area Codes, but these
apply to North America.

http://www.nanpa.com/area_codes/

Nov 21 '05 #6
thanks everyone for the great advice.
Rodchar

"rodchar" wrote:
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

Nov 21 '05 #7
In article <38**********************************@microsoft.co m>, rodchar wrote:
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 :)

--
Tom Shelton [MVP]
Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: joemono | last post by:
Hello everyone! First, I appologize if this posting isn't proper "netiquette" for this group. I've been working with perl for almost 2 years now. However, my regular expression knowledge is...
4
by: Brian Henry | last post by:
I have phone numbers like this in a data table 123-435-1234 1231231234 432.234.2321 they all have different formatting, what I want to do is get them all formatted like this (123) 123-1234
4
by: Earl | last post by:
I'm curious if there are others who have a better method of accepting/parsing phone numbers. I've used a couple of different techniques that are functional but I can't really say that I'm totally...
10
by: JackM | last post by:
I'm still working on validating the phone numbers that are entered on a form but have come across a problem I don't understand how to fix. I can handle most instances when it's in regular US...
3
by: venu | last post by:
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should...
10
by: Petr Jakeš | last post by:
I have a standard 12-key mobile phone keypad connected to my Linux machine as a I2C peripheral. I would like to write a code which allows the text entry to the computer using this keypad (something...
4
by: lilOlMe | last post by:
I'd love to be able to validate phone numbers in my software but my product is being used world wide. Not everyone's phone number is formatted like USA/Canada formats theirs. I've found a few...
5
by: lim4801 | last post by:
I am currently in doing a program which is given by my tutor: Contemplate that you are working for the phone company and want to sell "special" phone numbers to companies. These phone numbers are...
4
by: Blue Streak | last post by:
Hello, Folks! Does anyone know of a website that lists the local phone number formats for each country? TIA...
7
by: Propoflady | last post by:
My contacts can have as many as five or six phone numbers - is it possible to make a query that puts the name, and each phone number after it on the same line - for this reason I have two tables -...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.