Simple clear advice in plain English

Why does Access treat a phone number as text?

Find out why databases see numbers as text

Q I have built a little database with a field for phone numbers (Access 2007) but when I enter a number like 02222 222222 a message pops up to say ‘The value you entered does not match the Number data type in this column’ and one of the options it offers is ‘Convert the data in this column to the Text data type’.

Why does it want to do this rather than allow me to store numbers in a Number field?

Bill ‘Numerate’ Watkins

A You and Access are both right here: phone numbers are made up of numbers but the difference is in the fact that, although numerical, we never treat phone numbers mathematically. We don’t add two numbers, or work out the average phone number in our address books (though it’s an interesting idea – if you dialled the average would you open up a conference call to them all at the same time?)

If we treat phone numbers as text, as Access wants us to, we gain several advantages. We can add the symbols and spaces that make the numbers more easily readable, like 02222-222222 or 02222 222222. (Incidentally it is the space in your example phone number that is alerting Access to the fact that the numbers are not going to be treated mathematically.)

We can also use leading zeros, which are not displayed by a Number data type, and leading ‘+’ for numbers in international dialling format (+44 2222-222222). Another benefit is that it is easy to find all such numbers because we can search for every entry beginning with +.

My advice is to implement the change of data type suggested by Access: it has advantages, no disadvantages and treating phone numbers as text is a good rule when building a database.

Article tags

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Security shield illustration

How to use the Command Prompt

Lurking under Windows is the little-known world of the command line. We explain how to use this to fix faults and make your PC much more secure

Using Wizard to create a form

Create a good Base for your data

Databases may sound very dreary but they are behind almost everything we do. We explain how to go about starting one of your own using Libre Office Base

337-f3-lp

How to sort lists easily in Word, Excel and Open Office columns

Microsoft Office and Open Office word processing and spreadsheet programs have simple ways of sorting lists of data in tables and spreadsheets

Question & Answer

Q.Why can't my browser find the website address I typed...

> Read the answer

Q.All updates have been downloaded, so why won't Windows...

> Read the answer

Q.How do I stop Windows 7 search?

> Read the answer

Best deals on the web

img

Apple MacBook Pro (MC724LL/A)

£999.99- Buy it now

img

Sony Vaio VPCF23P1E/B

£679.98- Buy it now

img

Samsung 300E5A-A01DX

£449.99- Buy it now

Great benefits for subscribers!

Most popular articles

Poll

Which is your preferred web browser

Jargon Buster

Computing terms explained in plain English

VGA

Video Graphics Array. Standard socket for connecting a monitor to a computer.

Great shopping deals from Computeractive