Progress
Report Builder
User’s Guide
INDEX-NTH
Returns the beginning position of the nth occurrence of a character substring.
SYNTAX
source
A character expression (a constant, field name, or expression that results in a character value).
target
A character expression whose position you want to locate in source. If target includes fewer occurrence instances of source, INDEX-NTH returns 0.
occurrence
The numeric expression representing the number of the occurrence. If n is negative, INDEX-NTH returns UNKNOWN.
EXAMPLETo extract the year part of a character string that contains a date delimited by slashes (/), create a field with the following expression:
A simple SUBSTRING is not useful in this example because the position of the second slash in the date string is variable depending on how many digits are used for month and day. You can extract the year part of a date field or constant using the YEAR function.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |