RIGHT function
The RIGHT function returns the rightmost string of characters of the specified length.
The arguments are defined as follows:
stringExpression | Specifies the rightmost characters of an input string The input string expression must be in one of the following data types:
The result is a string that is the same data type as the input string, in varying format. |
length | Specifies the length of the result The value must be a positive integer value in either a constant or an expression form. The value cannot be larger than the maximum length of the input string. The length value is implicitly expressed in the same units as the input string. For example, if the input string is a GRAPHIC type (double-byte character string) and length has a value of 2, the total number of bytes in the result is 4. If the current length of the input string is less than the length value, the result string is effectively padded on the right. The string is padded with the necessary number of padding characters, and in the same encoding scheme as the input string. |
Related topics