Proper tel format

J

John

Hi

How can I convert a tel number like 020 5555 4171 into +44 (0) 20 5555 4171?

Many Thanks

Regards
 
L

Larry Linson

John said:
Hi

How can I convert a tel number like 020 5555 4171 into +44 (0) 20 5555
4171?

As there is no universal, international format for telephone numbers, other
than the +nn country code, that's a little difficult to answer. You
certainly cannot just assume that the country code is +44, unless that is
the case for all the numbers you deal with.

There's some information that may or may not be useful to you at
http://www.xml.gov.hk/en/approved/telephone_number_v1_0.htm -- note that it
is perhaps just specific to Hong Kong. Another is
http://www.fws.gov/stand/standards/de_intertelephone.html but it, too, is
limited in scope.

Larry Linson
Microsoft Access MVP
 
W

Wayne-I-M

Hi John

Following on from Larry's post - if you are sur you want this, I would not
store it in a table - use it on a form to help users. You can use this

SELECT "+44 " & "(0) " & RTrim([TableName]![PhoneNumber]) AS TelNo
FROM TableName;

Or just put this into a calculated field
TelNo: "+44 " & "(0) " & RTrim([TableName]![PhoneNumber])

But, as Larry mentioned it will not work ??. In the UK most people just
give the last section of the number (without the code) so the above will give
you the wrong phone number. Also bear in mind that this can not be used for
autodialers as there are spaces in the resulted calculated field.

But I hope this points you in the right direction.
 
Top