Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Phone field
Message
De
25/06/2002 12:59:39
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00672067
Message ID:
00672091
Vues:
9
>Hi all,
>
>I am trying to a search on parts of a phone number field
>The US phone numbers are formatted as follows 1-617-454-5842
>I have an index on the entire field and therefore can only look
>up the entire field.
>I want to be able to pull up all the 617 or even look up maybe the 5842
>endings or ideally any/all parts of the number.

If by "parts," you mean the different sections of the phone number, you may want to index on each:

INDEX ON SUBSTR(Phone, 3, 3) TAG AreaCode
INDEX ON SUBSTR(Phone, 7, 3) TAG Exchange
INDEX ON SUBSTR(Phone, 11,4) TAG Number

Then, you can use SEEK for any of these parts.

It's probably also worth pointing out that most people don't bother to store the punctuation as part of the field, since it's easy to see it in forms and reports using an InputMask.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform