Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Normalizing phone number data
Lance Broxson 
     
3 years ago
I have had this database for several years and I am trying to normalize the data in my customer table. Have phone data that is (806)999-4444 or 999-4444 or 999-444 His cell or 8806-999-8888 Gracie's Work. We have sometimes have at the end of number his cell, her cell, a name of person # belongs to. I am trying to split these phone numbers into a contact table. Trying to put phone number in a field and if it has text at end of phone number split it out and put in phone type field. I'm sure I'm missing it but I have tried left, right ,mid, but I have not found the right function criteria. Can anybody lead me in the right way. Thanks
John Davy  @Reply  
         
3 years ago
Watch Richard's Replace Function Video https://599cd.com/blog/display-article.asp?ID=1083

John
Scott Axton  @Reply  
        
3 years ago
Richard Rost  @Reply  
          
3 years ago
Yeah, that's exactly what I would do. I would strip out any non-numeric characters, store just the numbers in the field, run an update query on the existing data, and feed it through my filter function. Then, I would put an after-update event on that field so anytime new data is entered, it strips out everything but the numbers.
Kevin Yip  @Reply  
     
3 years ago
This is not a simple task due to the free-form nature of your data: phone number can have 10 digits, 7 digits, 6 digits, with or without dashes, spaces, or parentheses.  You could look for the last numeric character to see where the phone number ends and the description begins.  But what if the description has numeric data too: E.g. "123-456-7890 8am to 4pm work phone."  So it's tough to separate the phone# and the description.  My advice is to find a way to make all the phone numbers *uniform*: all 10 digits long, or all 12 characters long if you include two dashes, or 14 characters long if you want the (000) 000-0000 format.  Convert all the phone numbers to an identical format.  If they are missing area codes, fill them in.  Missing -, (, or ), fill them in.  Make them all look like (000) 000-0000, and you'll be sure the description starts at the 15th character onward.  A simple function most likely can't do this.  You need VBA to loop through all the phone numbers and convert them case by case:  If it's 000-0000, add area code; if its 000-000, add missing digit and area code; etc.  If there are other odd formats, you may have to edit them manually if VBA can't account for them all.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 4:31:39 AM. PLT: 1s