Mid() and Len() Function in MS Access

1. Mid() function :
In MS Access the mid() function will extract the string from a given position. In this function 3 parameters will be passed first will be the string and second will be the starting position and last will be the length of the string.

Syntax :

Mid(string, start, length)

Example-1 :

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

Output –

ExtractString
EKS

Example-2 :



SELECT Mid("GEEKSFORGEEKS", 6, 14) AS ExtractString;

Output –

ExtractString
FORGEEKS

2. Len() function :
In MS Access the Len() function will return the length of the string. It will take the string as a parameter and it will return the length of the string.

Syntax :

Len(string/varname)

Example-1 :

SELECT Len("GEEKSFORGEEKS") AS LengthOfString;

Output –

LengthOfString
13

Example-2 :

SELECT Len("GFG") AS LengthOfString;

Output –

LengthOfString
3
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.