Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2007, 08:21 AM
Registered User
 
Join Date: Feb 2007
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.
 
Old February 27th, 2007, 08:38 AM
Friend of Wrox
 
Join Date: Mar 2004
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
 
Old February 27th, 2007, 08:55 AM
Registered User
 
Join Date: Feb 2007
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).






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





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