>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.
>How do I go about doing this.
>
>Thanks in advance
>Carmel
Carmel,
If you need to do this then Phone number is not an atomic attribute and you should make the fields in the table atomic.
Fields
DialPrefix C(1)
CountryCode C(3)
AreaCode C(3)
Exchange C(3)
PhoneNumber C(4)
Extension C(6)
You can adjust the field lengths to handle international numbers if needed. You example number above would be stored as;
DialPrefix 1
CountryCode 001
AreaCode 617
Exchange 454
PhoneNumber 5842
Extension {blank}
Now you data is normalized to atomic fields and you can search on any part or parts of the phone number and have the search fully optimized.