image\Dql_0023.giffirstw

Type

Text Function

Purpose

The firstw function extracts a specified number of words from the beginning (left) of a text value.

Syntax

firstw( TEXT VALUE, n)

Returns

A text value n words in length.

Usage

firstw(FIELDNAME, n) returns the first n words in the field, including intervening punctuation symbols. Leading spaces are treated as delimiters. Trailing spaces are ignored. If there are n or fewer words in the field, firstw returns the original text value.

Examples

firstw( "Sapphire International Ltd." , 2)

Returns: Sapphire International,

 

firstw( "Club ParaDEASE" , 1)

Returns: Club

 

firstw( ADDRESS , 2)

Returns:The first two words in the ADDRESS field for every record that is processed. If a record contains the value 540 Avenida de los Delfines in the ADDRESS field, the function returns 540 Avenida.