PhoneNormalize()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

PhoneNormalize()

Syntax

PhoneNormalize( <CharacterField> )

 

Purpose

To add the required formatting to a phone number.

 

Parameters

<CharacterField> can be the name of any character field in DonorQuest, but it is usually a name of a field in which a "raw" (unformatted) telephone number has been entered or imported.

 

Returns

PhoneNormalize() will return the contents of the specified character field with all digits assembled and formatted into a proper phone number of the form "(nnn) nnn-nnnn".

 

Usage

DonorQuest requires that telephone numbers be properly formatted for consistent searching and sorting. If you import telephone numbers from other programs which lack this discipline, it may be necessary to apply the PhoneNormalize() function to the imported telephone numbers.

 

To perform such a conversion, you would proceed by performing a selection for the donors with the newly imported telephone numbers. You would then use the replace command (see section seven) while viewing the selection result to apply the PhoneNormalize() function to the telephone fields which require it.

 

Of course, you could also keep the imported telephone numbers in their imported form if you wish, and simply use the PhoneNormalize() function with the report writer to have telephone numbers look nice on printed reports. However, these unformatted phone numbers would still be a problem during sorting and searching operations.

 

Example

The following examples illustrate PhoneNormalize():

 

CALL

RESULT

PhoneNormalize( "4155728188" )

(415) 572-8188

PhoneNormalize( "5728188" )

572-8188

PhoneNormalize( "572-8188" )

572-8188

PhoneNormalize( "415 572-8188"

(415) 572-8188