Zero not showing up in telephone numbers (1 Viewer)

m33r4

Registered User.
Local time
Today, 07:26
Joined
May 5, 2013
Messages
11
:confused:Any tips on how I can get the zero in my telephone dialling code to show up in my tables please?

I have set the number display to the Long Integer.

Thanks.
 

m33r4

Registered User.
Local time
Today, 07:26
Joined
May 5, 2013
Messages
11
Set the data type to text.
Thanks for the tip.

I suppose that setting the data type to TEXT won't affect any queries or reports on local dialling codes?
 

bob fitz

AWF VIP
Local time
Today, 07:26
Joined
May 23, 2011
Messages
4,727
Thanks for the tip.

I suppose that setting the data type to TEXT won't affect any queries or reports on local dialling codes?
Not that I can think of but if you have any vba code that uses the field in a "WHERE" condition you would need to use single quotes as delimiters.
 

m33r4

Registered User.
Local time
Today, 07:26
Joined
May 5, 2013
Messages
11
Why wouldn't you use imput mask?
I tried a few but still missed out the zeros.

Have you any suggestions for input mask to cover the UK dialling codes please?

Whilst on input masks, would you also have any ideas for UK postcodes please as that is proving tricky with it varying from DE56-2JP to N2-8EW?

Many thanks.
 

RainLover

VIP From a land downunder
Local time
Today, 16:26
Joined
Jan 5, 2009
Messages
5,041
I don't know what the UK system is.

There is a help file attached to the Input Mask.

Use that it is not too hard to work out.

This is the Aussie equivalent of what you want.

!\(00") "0000\ 0000;0;_
 

catalin.petrut

Never knowing cleric
Local time
Today, 09:26
Joined
May 3, 2013
Messages
118
I don't really know UK phone numbers format, but i think this could work: "+44 0 "000 000 0000.
For the postcodes, you could use: aaaa"-"AAA. a is optional (letter or a digit) and A is mandatory.
Try it! Feedback!
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 16:26
Joined
Jan 20, 2009
Messages
12,852
AFAIK, leading zeros in any phone number anywhere in the world are not actually part of the subscriber's number but a dialling access code.

In Australia the area codes are a single digit. For example for a New South Wales number they are typically written as:
(02) xxxx xxxx

When dialling from international locations that zero is not included.
61 2 xxxx xxxx


I prefer to provide separate fields for:
International Code
Area Code
Number
Extension

The main part of the number and be stored efficiently as a Long integer.

Users can type 2 or 02 for the area code and the same value will be stored. Extraneous formatting such as brackets and dashes are not included.

Any number can easily be displayed in any required context in any format.
 

wmphoto

Registered User.
Local time
Today, 07:26
Joined
May 25, 2011
Messages
77
UK phone number are all 11 digits (including the preceding zero)

Major cities have 4 digit area codes and 7 digit numbers, smaller towns and cities have 5 digit area codes and 6 digit numbers. Occasionally you'll come across a supposed 6 digit area code with a 5 digit number, but this isn't really a separate area code.

The main bone of contention with UK numbers is that unlike most places mobile phone numbers don't have area codes, they're just a long 11 digit number but tend to written as XXXXX XXX XXX. Personally I just prefer to have a text field for the entire number than try and mess around with separate fields for area codes of varying length which not all numbers even have.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 16:26
Joined
Jan 20, 2009
Messages
12,852
UK phone number are all 11 digits (including the preceding zero)

As I said before the leading zero is is an access code and not part of the number. The call will fail if it is included when dialling from an international location.

The main bone of contention with UK numbers is that unlike most places mobile phone numbers don't have area codes, they're just a long 11 digit number but tend to written as XXXXX XXX XXX.

Mobile "area codes" in UK are 7xxx.

Personally I just prefer to have a text field for the entire number than try and mess around with separate fields for area codes of varying length which not all numbers even have.

All numbers have an area code. It simply isn't dialled when the caller is in the same area.
 

jdraw

Super Moderator
Staff member
Local time
Today, 02:26
Joined
Jan 23, 2006
Messages
15,379
m33r4,

You will find that using a Number data type is only needed when you are actually doing some arithmetic operation (add/subtract...) on the number. I haven't seen an instance of your telephone number divided by 3 sort of thing, but I'm sure there is someone, somewhere thinking of how that might be be used.

Many "numbers" are really text strings that have inherited some mis-naming.

Good luck with your project.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 16:26
Joined
Jan 20, 2009
Messages
12,852
You will find that using a Number data type is only needed when you are actually doing some arithmetic operation (add/subtract...) on the number.

Yes that is when it is needed but there are advantages to using numbers where that is practical.

A Long integer uses four bytes for the entire number (reliably storing up to eight characters) while text use two bytes per character. Indexing a Long is much faster than indexing text.

In the case of a telephone number a Long automatically prevents the inclusion of arbitrary brackets, dashes, slashes and other extraneous text characters without requiring validation or an input mask.
 

Users who are viewing this thread

Top Bottom