V:3.5 Need syntex to change Area Codes in Phone Number Field 
Author Message
 V:3.5 Need syntex to change Area Codes in Phone Number Field

Either using CHANGETO function, or PAL program, I need the correct syntex
to convert an Area Code from an old area code number to a new area code
number.  The field is based on an A14 using a phone number format of
(###) ###-####.

If you have had a prior experience with this process, I would appreciate
your comments.




Sun, 17 Oct 1999 03:00:00 GMT
 V:3.5 Need syntex to change Area Codes in Phone Number Field

Quote:

>Either using CHANGETO function, or PAL program, I need the correct syntex
>to convert an Area Code from an old area code number to a new area code
>number.  The field is based on an A14 using a phone number format of
>(###) ###-####.

You can't use a ChangeTo query on a sub field (partial). That leaves
PAL.
If your Phone numbers are Normalised, the it is simple.
Co_edit <your table>
        Scan For Match([field], "(415) ..-..",ac, office,nbr)  
                        ;(415) 123-4567  note space after ac
           [field] = "(560) " + office + "-" + nbr
        EndScan
Do_it!

the ac must be an exact match and will be replaced with the new (AC)
BTW the above example is BAD because All 415 numbers are Not changing
You need to limit it to affected offices eg 123
I create s string with a separator "123|124|125|" ;Note trailing |
and then
 If Search(office+"|", <the string>) = 0 Then
        ;don't chng this office
 Else           ;found it in our list to do
           [field] = "(560) " + office + "-" + nbr
 EndIf

Steve      

Quote:

>If you have had a prior experience with this process, I would appreciate
>your comments.



        _
       | \                           Steve Urbach
       |  )erek

  / / /                              http://www.greenduck.com


Sun, 17 Oct 1999 03:00:00 GMT
 V:3.5 Need syntex to change Area Codes in Phone Number Field


Quote:

>Either using CHANGETO function, or PAL program, I need the correct syntex
>to convert an Area Code from an old area code number to a new area code
>number.  The field is based on an A14 using a phone number format of
>(###) ###-####.

>If you have had a prior experience with this process, I would appreciate
>your comments.

I'm no help on the syntax but set up your scheme so that it is easy for
the area code to be changed per record.   As a user encounters a record
that needs changing, make it easy for the user to do while looking at the
record.  (This is contrasts to wholesale changes or file cleanup schemes -
a very rare need for the proliferation of new area codes).

The only worthwhile wholesale thing would be to drop those parentheses
around the area code - obsolete.  And many globally oriented organizations
are switching to periods as seperators, rather than dashes.  




Sun, 17 Oct 1999 03:00:00 GMT
 V:3.5 Need syntex to change Area Codes in Phone Number Field


Quote:
>Either using CHANGETO function, or PAL program, I need the correct syntex
>to convert an Area Code from an old area code number to a new area code
>number.  The field is based on an A14 using a phone number format of
>(###) ###-####.

>If you have had a prior experience with this process, I would appreciate
>your comments.



You'll have to scan down the table and check for each area code to be
changed.

Example (Using change to 905 from 416):

EDIT "PHONE"
MOVETO [Phone_Number]                          ;position to field
SCAN
        IF SUBSTR([ ],2,3) = "416" THEN
                [ ] = "(905)" + SUBSTR([ ],6,9)
        ENDIF
ENDSCAN
Do_It!  



Thu, 21 Oct 1999 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Changing Area Code in Phone Numbers

2. Help in extracting area codes and numbers from a single phone field

3. Formatting fields for phone number with area codes

4. Code to spot patterns in phone numbers needed:

5. Code to spot patterns in phone numbers needed:

6. New User needs help manipulating phone number field

7. Zipcodes & Phone Area Codes

8. Phone number validation code

9. UK phone number change SQL

10. Need Area Code and Zip Code file for database

11. Data type for Phone Number field

12. Phone number field.


 
Powered by phpBB® Forum Software