Access中电话号码的数据类型
问题描述:
我正在使用Ms Access 2007,其中我正在创建一个存储电话号码n邮政编码的应用程序...
我应该使用哪种数据类型来存储10位数的电话号码?
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?
答
我会为电话号码和邮政编码使用基于文本的字段。
并非所有电话号码都只是数字:您还可以添加'(',')'括号来分隔区号,'+'代表国际代码前缀,还可以添加空间以供人类阅读。另外,有些从零开始,将被数字字段删除。
邮编/邮政编码也可以是非数字的:我的例如是两个alpha,一个数字,一个可选空格,一个数字和两个字母字符。
通常,如果一个值是一个可以在现实世界中合理增加的数字,那么将其存储在数字字段中。如果是日期或时间,请使用该字段类型。如果你不能有意义地进行数学计算,即使它只是你文化中的数字,也要使用字符串字段。什么是邮政编码+ 603?或电话号码/ 7? :笑:
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:
我会用
I would use
TEXT VARCHAR SQL_VARCHAR[1] SQL_WVARCHAR[2]
,因为特殊字符如+,等等。
because of special character like "+", " " and so long.
我们应该使用Long text作为数据类型来添加手机号码,地址等
We should use Long text as data type for adding mobile number,adress etc