Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 27th, 2007, 08:21 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update query: Editing phone number fields?

Hi,

I have a problem that a simple update string should fix though i am not familiar with the syntax. I have fields full of phone numbers that i need to do two things to:

1. remove the first digit of the area code

2. add an international calling code

So a number like "02-8765-7464" needs to become "0011-61-2-8765-7464".

At first i tried an update string that updated the code by counting from the right, but some numbers have different amount of digits! So please if you can suggest a way from the left to remove the first digit and add in "0011-61-" id appreciate :)

Thanks,

M.
Reply With Quote
  #2 (permalink)  
Old February 27th, 2007, 08:38 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You would update this using:

Right([PhoneNumber], Len([PhoneNumber]) - 1)

Then update it again using a seperate query and:

"0011-61-" & [PhoneNumber]

Did that help?

mmcdonal
Reply With Quote
  #3 (permalink)  
Old February 27th, 2007, 08:55 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much. The update of the additional characters was logical, i just hadnt to date learnt how to specify the -1... i was counting from the end which came unstuck when a number of differing length to my absolute query popped up :P

Thanks again! Im seeing how forums might fill the gaps between hardcopy documentation (in moderation! :P).

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 07:24 AM
Getting mobile phone number yukijocelyn C# 2005 0 May 28th, 2008 11:43 PM
Dial a phone number? seananderson Pro VB 6 2 August 3rd, 2007 08:04 AM
phone number brackets dhoward VB.NET 2002/2003 Basics 1 November 8th, 2006 11:58 AM
reformat phone number netcrawler Classic ASP Databases 1 November 3rd, 2004 09:01 PM



All times are GMT -4. The time now is 07:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.