MS Access LTrim() Function

The LTrim() function in MS Access removes leading spaces (spaces at the beginning) from a string. This is a handy function for data cleaning and ensuring data consistency.



LTRim(): Definition and Usage

Leading whitespace (spaces at the start of a string) can sometimes cause issues in string comparisons or other text operations. LTrim() efficiently removes these leading spaces, leaving you with just the essential text. It only removes spaces from the very beginning of the string; any spaces within the string or at the end are not affected.

Syntax

Syntax

LTrim(string)
      

Parameter Values

Parameter Description
string The string from which to remove leading spaces. This is required.

Related Function

For removing trailing spaces (spaces at the end of a string), use the RTrim() function.

Example

Removing Leading Spaces

This example demonstrates removing leading spaces from the string " SQL Tutorial".

Syntax

SELECT LTrim("   SQL Tutorial") AS LeftTrimmedString;
      
Output

SQL Tutorial