Left() and Right() Function in MS Access

1. Left() Function :
In MS Access the Left() function extract the string from the left of the string. In Left() function The string and the no of the string will be passed. And it will return the string of size the pass number from the left of the string.

Syntax :

Left(string, number_of_chars)

Example-1 :

SELECT Left("GEEKSFORGEEKS", 3) AS ExtractString;

Output –

ExtractString
GEE

Example-2 :



SELECT Left("GEEKSFORGEEKS", 10) AS ExtractString;

Output –

ExtractString
GEEKSFORGE&

2. Right() Function :
The Right() function works like Left() function but it extracts the string from the right end of the string. In this, the string and the size of the string that will be extracted will pass as a parameter.

Syntax :

Right(string, number_of_chars)

Example-1 :

SELECT Right("GEEKSFORGEEKS", 4) AS ExtractString;

Output –

ExtractString
EEKS

Example-2 :

SELECT Right("GEEKSFORGEEKS", 8) AS ExtractString;

Output –

ExtractString
FORGEEKS
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.