<< Click to Display Table of Contents >> Navigation: Available Functions > But_Last() |
Syntax
But_Last( <CharacterField>, <Delimiter> )
Purpose
To extract all but the last word from a field.
Parameters
<CharacterField> is the name of any character field in DonorQuest, such as the last or first name field.
<Delimiter> is usually a quoted space (" "). In general, <Delimiter> is whatever separates words within the field from which you wish to extract all but the last word. In most cases, words within fields are separated by a space, but you may also have fields in which commas or semicolons are used to separate words or groups of words.
Returns
All but the last word from within <CharacterField>.
Usage
But_Last() can be used with reports to omit the last word from any character field. One possible use of this function would be to design a donation report which would omit the last word of the second name field. Since the second name field is generally used to store the full name of a partner or spouse (in the case of individual donors) or the name of the contact person for an organization, applying the But_Last() function to the second name field would return everything but the last name from the second name field.
Example
The following example illustrates the use of But_Last().
CALL |
RESULT |
---|---|
Second_Name. |
James A. Smith |
But_Last( .Second_Name., " " ) |
James A. |