MS Access: Left Function
In Microsoft Access, the Left function extracts a substring from a string, starting from the left-most character.
The syntax for the Left function is:
Left ( 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 left-most character.
If number_of_characters exceeds the number of characters in text, the Left function will return text.
- Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000
|Left ("Tech on the Net", 4)||would return "Tech"|
|Left ("Alphabet Soup", 5)||would return "Alpha"|
|Left ("Alphabet", 20)||would return "Alphabet"|
The Left function can be used in VBA code. For example:
Dim LResult As String LResult = Left ("Alphabet",3)
The variable LResult would now contain the value of "Alp".
You can also use the Left function in a query.