MS Access RTrim() Function
The RTrim()
function in MS Access removes trailing spaces (spaces at the end) from a string. This is a very useful function for data cleaning and ensuring that your text data is consistent.
RTrim(): Definition and Usage
Trailing whitespace can sometimes interfere with database operations or comparisons. RTrim()
is a simple way to clean up strings by removing only those trailing spaces. It doesn't affect any spaces that are within the string itself.
Syntax
Syntax
RTrim(string)
Parameter Values
Parameter | Description |
---|---|
string |
The string from which you want to remove trailing spaces. This is required. |
Example
Removing Trailing Spaces
This example shows how RTrim()
removes trailing spaces from the string "SQL Tutorial ".
Syntax
SELECT RTrim("SQL Tutorial ") AS RightTrimmedString;
Output
SQL Tutorial