Home page
or browse popular tags
Access Functions

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: RTrim Function


In Access, the RTrim function returns a copy of a string with trailing spaces removed.

The syntax for the RTrim function is:

RTrim ( string )

The string argument can be any string expression. If string contains Null, Null is returned.


RTrim("  WebCheatSheet " )        returns " WebCheatSheet"
RTrim("tutorials ")                      returns "tutorials"
RTrim(" articles")                       returns " articles"

VBA Code

Dim MyString, RTrimString
MyString = " Access "
RTrimString = Trim(MyString)

This example uses the RTrim function to strip trailing spaces from a string variable. Now the MyString variable would contain the value " Access".

SQL query

You can also use the RTrim function in a query.

SELECT RTrim([ItemDesired]) AS Expr1
FROM Orders

If you'd like to see how it works, enter SQL statement and press Execute


Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments

Copyright © 2005-2023             www.WebCheatSheet.com All Rights Reserved.