Function: Right

Description

Extracts a string of specified length from the end of another string.

Syntax

Right(string,n)

Arguments

string can be a constant, a character field, an expression that results in a string or a function that returns a string.

n is the length of the substring you want to extract. The length can be a constant, a numeric field, an expression that results in a number or a function that returns a number.

Return value

This function returns a character string.

Calculated field example

If the Company field contained the value Widgets Inc., the following calculated field expression would return Inc.: Right(Company,4)

Note: Right(Company,4) returns the last four characters in the Company field. If the Company field contains trailing spaces, use the RTrim function inside the Right function to first remove the trailing spaces, as in Right(RTrim(Company,4))

Filter/Find example

Records with a Company field value of Xerox Corp. or FMC Corp. can be selected or found using the expression: Right(RTrim(Company),5)="Corp."

 

 

© 2024 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support