Click here to Skip to main content
15,887,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I m Using Ms Access 2007 in which I'm creating a application that Stores Phone number n Zip code...
What data type should I use to store 10 digit Phone number?
Posted
Updated 10-May-20 4:08am
v2
Comments
[no name] 14-Mar-13 9:42am    
If you are not storing ( or - (or other non numeric characters) with your phone number then store it as a number.
chaitali chandane 14-Mar-13 9:55am    
yeah.... i did that..... but getting error.."Datatype mismatch in criteria expession"
[no name] 14-Mar-13 10:09am    
Okay.... so? Maybe you should ask a question about your error instead of a vague question about what datatype to use in a table.
Maciej Los 14-Mar-13 16:16pm    
Is it a question about creating MS Access table or is it a question about errors in query?
samadhan_kshirsagar 18-Mar-13 10:07am    
you give datatype as a number in table also and the time of inserting record in that table that time you must insert only numbers...then check it will work

I would use a text based field for both the telephone number and the Zip / Postal code.
Not all phone numbers are just numeric digits: you can also add '(', ')' brackets to delimit an area code, '+' for International code prefixes, and spaces for human readability. In addition, some start with a zero which would be removed by a numeric field.

Zip / Postal codes can also be non numeric: mine for example is two alpha, one numeric, an optional space, one numeric, and two alpha characters.

Generally, if a value is a number that can be incremented sensibly in the real world, then store it in a numeric field. If it's a date, or time, use that field type. If you can't do math with it meaningfully even if it is only numbers in your culture, use a string field. What is a Zip code + 603? or a Telephone number / 7? :laugh:
 
Share this answer
 
I would use
SQL
TEXT VARCHAR SQL_VARCHAR[1] SQL_WVARCHAR[2]

because of special character like "+", " " and so long.
 
Share this answer
 
We should use Long text as data type for adding mobile number,adress etc
 
Share this answer
 
Comments
CHill60 3-Nov-17 14:52pm    
You have added nothing to the thread. And Long Text would not be appropriate if you're using Access. Shorttext is sufficient at 255 characters.
Stick to answering new questions

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900