Advantage Concepts
Advantage Expression Engine function that extracts a substring from a character string
SUBSTR(<cString>, <nStart>, [<nCount>]) à cSubstring
<cString> |
The character string from which to extract a substring. It can be up to 65,535 (64K) bytes, the maximum character string size. |
<nStart> |
The starting position in <cString>. If <nStart> is positive, it is relative to the leftmost character in <cString>. If <nStart> is negative, it is relative to the rightmost character in the <cString>. |
<nCount> |
The number of characters to be extracted. If omitted, the substring begins at <nStart> and continues to the end of the string. If <nCount> is greater than the number of characters from <nStart> to the end of <cString>, the excess numbers are ignored. |
SUBSTR() returns a character string.
SUBSTR() is a character function that extracts a substring from another character string. SUBSTR() is related to the LEFT() and RIGHT() functions which extract substrings beginning with leftmost and rightmost characters in <cString>, respectively.
The SUBSTR(), RIGHT(), and LEFT() functions are often used with both the AT() and RAT() functions to locate either the first and/or the last position of a substring before extracting it. They are also used to display or print only a portion of a character string.
Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.
Note Memo, binary, and image fields are not supported in this Advantage Expression Engine function. If memo, binary, or image fields are used with this expression engine function, the Advantage Expression Engine will be unable to evaluate the expression.