image\Dql_0023.giffirstlast

Type

Text Function

Purpose

The firstlast function converts a text value from the format: LastName, FirstName[M.] to the format: FirstName[M.]LastName. The [M.] is an optional middle initial (or name).

Syntax

firstlast( TEXT VALUE)

Returns

A text value.

Usage

This function is used when names are stored in a single field. The contents of the field are rearranged so the first word (i.e., the last name) becomes the last word in the returned string. If the name is followed by a comma, the comma is deleted.

Examples

firstlast ( "Anthony, Susan B." )

Returns: Susan B. Anthony

 

firstlast ( "Eliot, T.S." )

Returns: T.S. Eliot

 

firstlast ( FULL NAME)

Returns: The value in the FULL NAME field in the format shown above for every record that is processed. If a record contains the value Holmes, Sherlock in the LAST NAME field, the function returns Sherlock Holmes.