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)
- How can I modify a saved Microsoft Access 2007 or 2010 Import Specification? +31 (2008)
- OleDbCommand parameters order and priority +28 (2009)
- What do I need to read Microsoft Access databases using Python? +25 (2009)
- MS Access library for python +24 (2009)
- is there any replacement of Access? +21 (2009)
- MS-Access – you tried to execute a query that does not include the specified aggregate function +17 (2013)
ms-access solutions on this site
— top 5%.