CountyValidForZip()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

CountyValidForZip()

Syntax

CountyValidForZip( <cZip>, <cCounty>, <IgnoreCase> )

 

Purpose

Given a specific zip code and county name, this function will return true if the given zip and county are a valid combination to use in an address. When used in a custom selection, this function can identify the constituents in your database which have an invalid zip and county combination in their mailing address. Once in a selection result, these invalid addresses may then be viewed and corrected as a group. A typical custom selection expression using this function would be: CountyValidForZip( .Zip., .County. )

 

Parameters

<cZip> Is the zip code to check. Must be a character (alpha-numeric) value since zip codes may contain a dash. In a custom selection, this is typically the .Zip. field, though it may be any field containing a zip code.

 

<cCounty> Is a character value giving the county to check. In a custom selection this is typically the .County. field, though it may be any field containing a county name.

 

<IgnoreCase> Pass as True if you wish case to be ignored when checking whether or not a given zip and county combination are valid. Defaults to True.

 

Returns

A true/false value.

 

Usage

This function can be used with custom selections. For example, a custom selection could be written to find all the constituents which have an invalid zip and county combination in their main address.

 

Example

The following examples illustrate various results of CountyValidForZip():

 

CALL

RESULT

CountyValidForZip( "83864", "Bonner" )

True

CountyValidForZip( "83864", "King" )

False

CountyValidForZip( "83864", "BONNER" )

True

CountyValidForZip( "83864", "BONNER", .F. )

False

CountyValidForZip( "60657", "Cook" )

True