THE WORLD'S LARGEST WEB DEVELOPER SITE

MS Access Mid() Function

❮ MS Access Functions

Example

Extract a substring from a string (starting at position 3):

SELECT Mid("SQL Tutorial", 3) AS ExtractString;
Try it Yourself »

Definition and Usage

The Mid() function extracts a substring from a string (starting at any position).

Syntax

Mid(string, start, number_of_chars)

Parameter Values

Parameter Description
string Required. The string to extract from
start Required. The start position
number_of_chars Optional. The number of characters to extract. If omitted, the Mid() function will return all charcters after the start position

Technical Details

Works in: Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000

More Examples

Example

Extract a substring from the text in a column (starting at position 4, and extract 6 characters):

SELECT Mid(CustomerName, 4, 6) AS ExtractString
FROM Customers;
Try it Yourself »

❮ MS Access Functions