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 –
Example-2 :
SELECT Mid("GEEKSFORGEEKS", 6, 14) AS ExtractString;
Output –
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 –
Example-2 :
SELECT Len("GFG") AS LengthOfString;
Output –
Last Updated :
01 Sep, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...