Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 To: Nic Cross
  Where is Nic Cross?
 
 California - United States
 Nic Cross
 Tags
Subject: RE: Parse Phone Number
Thread ID: 79002 Message ID: 79004 # Views: 3 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Wednesday, October 12, 2005 5:22:13 AM         
   


> Hello All!
>
> I have a database of 2,000 records and the field in question is a character field with a phone number in it (format: (555) 555 - 5555)
>
> I am going to create another field that will house the numeric parts of the number; however, I do not remember how to extract the number portions from the original field.
>
> I recall that each character/number has a value assigned to it. And something of the sort that with an FOR...ENDFOR statement that should verify the value of the number and skip it if it is that particular value.
>
> Of course unless someone has an easy way! Any help would be appreciated!!
>
> Nic


How about :

bb="(555) 999 - 44332"
nNumber = VAL(STRTRAN(STRTRAN(STRTRAN(STRTRAN(bb,"(",""),")",""),"-","")," ",""))


ENTIRE THREAD

Parse Phone Number Posted by Nic Cross @ 10/12/2005 4:41:36 AM
RE: Parse Phone Number Posted by Bernard Bout @ 10/12/2005 5:22:13 AM
RE: Parse Phone Number Posted by Dale Dedoroy @ 10/12/2005 5:30:12 AM
RE: Parse Phone Number Posted by Andy Kramek @ 10/12/2005 12:28:34 PM
RE: Parse Phone Number Posted by Hans de Groot @ 10/13/2005 5:44:47 PM