Is there an equivalent to the SUBSTRING function in MS Access SQL?

calendar_today Asked Apr 30, 2009
thumb_up 26 upvotes
history Updated April 16, 2026

Question posted 2009 · +19 upvotes

I want to do something like this within an MS Access query, but SUBSTRING is an undefined function.

SELECT DISTINCT SUBSTRING(LastName, 1, 1)
FROM Authors;

Accepted answer +26 upvotes

You can use the VBA string functions (as @onedaywhen points out in the comments, they are not really the VBA functions, but their equivalents from the MS Jet libraries. As far as function signatures go, they are called and work the same, even though the actual presence of MS Access is not required for them to be available.):

SELECT DISTINCT Left(LastName, 1)
FROM Authors;

SELECT DISTINCT Mid(LastName, 1, 1)
FROM Authors;

Top ms-access Q&A (6)

+26 upvotes ranks this answer #3 out of 55 ms-access solutions on this site — top 5%.