Advantage Concepts
Advantage Expression Engine function that returns the position of the last occurrence of a substring
RAT(<cSearch>, <cTarget>) à nPosition
<cSearch> |
The character string to be located. |
<cTarget> |
The character string to be searched. |
RAT() returns the position of <cSearch> within <cTarget> as an integer numeric value. If <cSearch> is not found, RAT() returns zero.
RAT() is a character function that returns the position of the last occurrence of a character substring within another character string. It does this by searching the target string from the right. RAT() is like the AT() function, which returns the position of the first occurrence of a substring within another string. RAT() is also like the $ operator, which determines whether a substring is contained within a string.
Both the RAT() and AT() functions are used with SUBSTR(), LEFT(), and RIGHT() to extract substrings.
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.