Open In App

Left() and Right() Function in MS Access

Last Updated : 02 Sep, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads