This MSAccess tutorial explains how to use the Access Left function with syntax and examples.
The Microsoft Access Left function extracts a substring from a string, starting from the left-most character.
The syntax for the Left function in MS Access 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.
The Left function can be used in the following versions of Microsoft Access:
Let's look at how to use the Left function in MS Access:
Left ("Tech on the Net", 4) Result: "Tech" Left ("Alphabet Soup", 5) Result: "Alpha" Left ("Alphabet", 20) Result: "Alphabet"
The Left function can be used in VBA code in Microsoft Access.
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 in Microsoft Access.
In this query, we have used the Left function as follows:
This query will return the first 10 characters from the CategoryName field and display the results in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
The results would now be displayed in a column called PartialName.
(scroll to see more)