PC Review


Reply
Thread Tools Rate Thread

Add a space to 11 numbers

 
 
=?Utf-8?B?UGF1bCBLLg==?=
Guest
Posts: n/a
 
      31st Jan 2006
I have a column of UK TELEPHONE no's with 11 digits in a line. I would like
to add a space between digit 5 and digit 6
12345678911
12345 678911
 
Reply With Quote
 
 
 
 
Rick B
Guest
Posts: n/a
 
      31st Jan 2006
This is done with the "format" in your forms and reports.


--
Rick B



"Paul K." <(E-Mail Removed)> wrote in message
news:E279E3F3-1E5E-4C87-A411-(E-Mail Removed)...
>I have a column of UK TELEPHONE no's with 11 digits in a line. I would like
> to add a space between digit 5 and digit 6
> 12345678911
> 12345 678911



 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      31st Jan 2006
In the query, add a field

NEW_UK_TELEPHONE: Left([UK_TELEPHONE],5) & " " & Mid([UK_TELEPHONE],6)

Or In SQL
Select Left([UK_TELEPHONE],5) & " " & Mid([UK_TELEPHONE],6) As
NEW_UK_TELEPHONE From TableName


--
\\// Live Long and Prosper \\//
BS"D


"Paul K." wrote:

> I have a column of UK TELEPHONE no's with 11 digits in a line. I would like
> to add a space between digit 5 and digit 6
> 12345678911
> 12345 678911

 
Reply With Quote
 
Nick Coe \(UK\)
Guest
Posts: n/a
 
      31st Jan 2006
Air code in a form class:- Assuming phone no field is
called PhoneNum

Dim strLeftPart, strRightPart, strOrig, strFixedUp as string

strOrig = Me.PhoneNum

strLeftPart = Mid(strOrig,1,5)
strRightPart = Mid(strOrig,6)
strFixedUp = strLeftPart & " " & strRightPart

'strFixedUp now contains the amended value.
Me.PhoneNum = strFixedUp

Alternatively you could run an update query against the
table with something like:

UPDATE tblPhoneNumbers
SET tblPhoneNumbers.HomePhone = Mid([HomePhone],1,5) & " " &
Mid([HomePhone],6);

You'll need to substitute your own table and field names.

--
Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

In news:E279E3F3-1E5E-4C87-A411-(E-Mail Removed),
Paul K. typed:
> I have a column of UK TELEPHONE no's with 11 digits in a
> line.
> I would like to add a space between digit 5 and digit 6
> 12345678911
> 12345 678911



 
Reply With Quote
 
aaron.kempf@gmail.com
Guest
Posts: n/a
 
      31st Jan 2006
more importantly; cant you just use a format string 00000 000000?

 
Reply With Quote
 
John Vinson
Guest
Posts: n/a
 
      31st Jan 2006
On Tue, 31 Jan 2006 07:16:29 -0800, "Paul K."
<(E-Mail Removed)> wrote:

>I have a column of UK TELEPHONE no's with 11 digits in a line. I would like
>to add a space between digit 5 and digit 6
>12345678911
>12345 678911


This should certainly be a Text field, not a number.

You can use the suggestions posted in this thread to temporarily or
permanently insert a space into the table (if it's a text field -
numbers of course don't allow spaces); or you can simply set the
Format property of the field to

@@@@@ @@@@@@


John W. Vinson[MVP]
 
Reply With Quote
 
Nick Coe \(UK\)
Guest
Posts: n/a
 
      1st Feb 2006
Yup.

--
Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

In
news:(E-Mail Removed),
(E-Mail Removed) typed:
> more importantly; cant you just use a format string 00000
> 000000?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
add a space between characters / numbers mike UH Microsoft Access 3 4th Nov 2009 08:44 PM
Add space between numbers Hema Microsoft Excel Worksheet Functions 2 10th Oct 2009 10:27 AM
Numbers followed by space malewis48 Microsoft Excel Misc 4 16th Jun 2009 07:47 AM
Disk space for 512-bit numbers ChrisW Microsoft Windows 2000 1 9th May 2007 10:18 PM
Remove space between numbers =?Utf-8?B?U29yZW4gTHlzdGVy?= Microsoft Outlook Contacts 2 16th Jun 2004 08:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:42 AM.