The Wayback Machine - https://web.archive.org/web/20211128171322/https://www.geeksforgeeks.org/ltrim-and-rtrim-function-in-ms-access/
Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

LTrim() and RTrim() Function in MS Access

  • Last Updated : 02 Sep, 2020

1. LTrim() Function :
In MS Access LTrim() function remove all the leading spaces from the given string. In LTrim() function a string will be pass as a parameter and it will return the string with no leading spaces.

Syntax :

Attention reader! Don’t stop learning now. Learn SQL for interviews using SQL Course  by GeeksforGeeks.

LTrim(string)

Example-1 :

SELECT LTrim("    GEEKSFORGEEKS") AS LeftTrimmedString;

Output –



LeftTrimmedString
GEEKSFORGEEKS

Example-2 :

SELECT LTrim("    GFG") AS LeftTrimmedString;

Output –

LeftTrimmedString
GFG

2. RTrim() Function :
It works same like LTrim() function but it will remove all trailing spaces from a string.

Syntax :

RTrim(string)

Example-1 :

SELECT RTrim("GEEKSFORGEEKS    ") AS RightTrimmedString;

Output –

RightTrimmedString
GEEKSFORGEEKS

Example-2 :

SELECT RTrim("GFG    ") AS RightTrimmedString;

Output –

RightTrimmedString
GFG
My Personal Notes arrow_drop_up
Recommended Articles
Page :