Extracts a substring from a string, starting from the rightmost, or last, character.
RIGHT(str, n)
The string from which to extract a substring.
The number of characters to extract, starting from the last character.
A substring of a specific length.
The following example displays the last four characters of each value in the ProductCode data field:
RIGHT([ProductCode], 4)
The following example uses RIGHT( ) in conjunction with the LEN( ) and FIND( ) functions to display the characters that appear after the hyphen in a product code. This example assumes that the number of characters after the hyphen varies. Therefore, the length of the entire string (returned by LEN( )) minus the length up to the hyphen (returned by FIND( )) is the number of characters to display.
RIGHT([ProductCode], (LEN([ProductCode]) - FIND("-" , [ProductCode])))
If the product code is ModelA-Ford, RIGHT( ) returns Ford. If the product code is ModelB-Toyota, RIGHT( ) returns Toyota.

Additional Links:

© Copyright OpenText Corp. All rights reserved. Privacy Policy | Cookie Policy

BIRT iHub 2