Find all records with the same first 3 characters Does anyone know how to return all records with the same first three characters in MS Access (I'm guessing this has to be done in the SQL view)?

For example

andria -doesn't match

Angie -match

Angela -match

Angel -match

Ann -doesn't match
You can use the LIKE operator to perform a wildcard search and return words that contain/start with specific patterns. Given your example above, you can issue the following query to return only those values that begin with "Ang":

SELECT * FROM people WHERE first_name LIKE 'Ang*';


You could CREATE a VIEW that is pre-filtered to only include the data that you want to be displayed:

CREATE VIEW filtered_people (first_name)
AS
SELECT first_name 
  FROM people
 WHERE first_name LIKE 'ang*';


Alternatively, you could just use the query in your code to obtain the data you need:

Sub LikeX() 

Dim dbs As Database, rst As Recordset 

' Modify this line to include the path to your database 
' on your computer. 
Set dbs = OpenDatabase("my.mdb") 

' Return a list of people whose name begins with ANG
Set rst = dbs.OpenRecordset("SELECT first_name" _ 
    &amp; " FROM people" _ 
    &amp; " WHERE first_name Like 'ang*';") 

' Populate the Recordset. 
rst.MoveLast 

' Call EnumFields to print the contents of the  
' Recordset. Pass the Recordset object and desired 
' field width. 
EnumFields rst, 15 

dbs.Close 

End Sub


You can find more information in the official documentation for MS Access SQL.