Descend()

<< Click to Display Table of Contents >>

Navigation:  Available Functions >

Descend()

Syntax

Descend( <CharacterField> )

 

Purpose

To alphabetize reports or mailing labels in descending order by any field or combination of fields.

 

Parameters

<CharacterField> is generally the name of the field you wish to alphabetize in descending order by. <CharacterField> may also be a combination of two or more fields.

 

Returns

Descend() will return <CharacterField> in an inverted form which lends itself to a descending alphabetical sort.

 

Usage

Both the report writer and label writer allow for the incorporation of a specific sort order expression as part of the report and mailing label formats. When the Descend() function is applied to this sort order expression, the resulting report will be in descending alphabetical order. For example, specifying a sort expression of:

 

.Last_Name. + .First_Name.

 

would result in a report or mailing label printout which would be sorted in ascending order by last name and first name. To create a descending sort order by last name and first name, you would apply the Descend() function like this:

 

Descend( .Last_Name. + .First_Name. )

 

Note that both .Last_Name. and .First_Name. are character fields. If you wish to mix character fields with other type of fields (such as date or numeric) in a single sort expression, you will have to use the appropriate conversion function to convert fields of date or numeric type to character. For example, to alphabetize donors by donation total, last name, and first name, you would use the following expression:

 

Str( .Donation_Total., 12, 2 ) + .Last_Name. + .First_Name.

 

For more information on establishing sort order expressions for reports and mailing labels, please refer to sections thirteen and fourteen, respectively.