MS Access: Right Function
The Microsoft Access Right function extracts a substring from a string starting from the right-most character.
Right Function (Syntax)
The syntax for the Right function is:
Right ( text, number_of_characters )
Text is the string that you wish to extract from.
Number_of_characters indicates the number of characters that you wish to extract starting from the right-most character.
The Right function can be used in the following versions of Microsoft Access:
- Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000
|Right ("Tech on the Net", 3)||would return "Net"|
|Right ("Alphabet", 5)||would return "habet"|
Right Examples (in VBA Code)
The Right function can be used in VBA code in Microsoft Access. For example:
Dim LResult As String LResult = Right ("Alphabet",3)
The variable LResult would now contain the value of "bet".
Right Examples (in SQL/Queries)
You can also use the Right function in a query in Microsoft Access.