Simplicty and flexibility!


Function::String

LastFirst
LastFirst(TEXT VALUE)
LastFirst("Scrooge MacDuck")
LastFirst(MyTextField)


The lastfirst function converts a text value from the format: First Name [M.] Last Name to the format: Last Name, First Name [M.].

Where [M.] is an optional middle initial.

The name of this function and the firstlast function refer to the format in which the names are stored in a single field.

Parameters


TEXT VALUE

The string that we want to move the first word to the end of.

Returns/Result


A text value.
The contents of the field are rearranged so that the last word (i.e.,the last name) becomes the first word in the returned value. A comma is automatically inserted after the last name.
Where [M.] is an optional middle initial.

Examples


Examples

lastfirst( Susan B. Anthony)

Returns: Anthony, Susan B.


lastfirst( T.S. Eliot)

Returns: Eliot, T.S.


lastfirst( 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 Roger Birnbaum in the FULL NAME field, the function returns Birnbaum, Roger.


Reference

lastfirst

Type

Text Function

Purpose

The lastfirst function converts a text value from the format: First Name [M.] Last Name to the format: Last Name, First Name [M.].

Where [M.] is an optional middle initial.

Syntax

lastfirst( TEXT VALUE)

Returns

A text value.

The contents of the field are rearranged so that the last word (i.e.,the last name) becomes the first word in the returned value. A comma is automatically inserted after the last name.

Usage

The name of this function and the firstlast function refer to the format in which the names are stored in a single field.

Examples

lastfirst( Susan B. Anthony)

Returns: Anthony, Susan B.

 

lastfirst( T.S. Eliot)

Returns: Eliot, T.S.

 

lastfirst( 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 Roger Birnbaum in the FULL NAME field, the function returns Birnbaum, Roger.

See Also


FirstLast
FirstW
LastW
MidW
StringFind
StringReplace

On the forum about LastFirst

On the blog about LastFirst


dg3_HelpView