RIGHT Function

Returns the right-most characters of a string.

Category: String
Returned data type: String

Syntax

RIGHT(source, count)

Required Arguments

source

specifies a string to be searched; this can be specified as string constant, field name, or expression.

Note If source is NULL, the function returns a NULL value.

count

specifies an integer that indicates how many characters to return; this can be specified as numeric constant, field name, or expression.

Note When count is zero or less, an empty string is returned.

Example

source = "abcdefg"
result = right(source, 4) // outputs the string "defg"
 
source = "abcdefg "
result = right(source, 2) // outputs the string "fg "