Easy to Create, Easy to Change - Easy to use!

Function::String

FirstLast

FirstLast(TEXT VALUE) FirstLast("Hilbert Hockenheim") FirstLast(MyTextField) FirstLast(Lookup Customer Customername)

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).

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.

If there is only one Word the function will do nothing.

Parameters


Text Value

Returns/Result


Thisfunctionis 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


Examples


firstlast("Anthony, Susan B.")

Returns: Susan B. Anthony


firstlast("Eliot, T.S.")

Returns: T.S. Eliot


firstlast(FULL NAME)

Returns: Thevaluein the FULL NAME field in the format shown above for every record that is processed. If a record contains thevalueHolmes, Sherlock in the LAST NAME field, thefunctionreturns Sherlock Holmes.


Reference

firstlast

Type

Text Function

Purpose

The firstlastfunctionconverts a textvaluefrom 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 textvalue.

Usage

Thisfunctionis 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: Thevaluein the FULL NAME field in the format shown above for every record that is processed. If a record contains thevalueHolmes, Sherlock in the LAST NAME field, thefunctionreturns Sherlock Holmes.


See Also


LastFirst FirstW LastW MidW StringFind StringReplace

On the forum about FirstLast

On the blog about FirstLast