Progress
Report Builder
User’s Guide


SUBSTRING

Extracts a portion of a character string from a field or expression.

SYNTAX

SUBSTRING ( source , position [ , length ] ) 

source

A character expression (a constant, field name, or expression that results in a character value) from which you want to extract a string of characters.

position

An integer expression (a constant, field name, or expression that results in an integer value) that indicates the position of the first character you want to extract from source.

length

An integer expression that indicates the number of characters you want to extract from source. If you do not use the length argument, SUBSTRING extracts all characters up to the end of source.

EXAMPLE

You might have a 12-character string (abcdefghijkl) and want to return the letters after a specified location. To return only the seventh letter through the end of the string, create a calculated field containing this expression:

SUBSTRING("abcdefghijkl", 7) 

The expression returns “ghijkl”.

To return only the seventh through the ninth characters, create a calculated field containing this expression:

SUBSTRING("abcdefghijkl", 7, 3) 

The expression returns “ghi”, which are the seventh, eighth, and ninth characters in the string.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095