Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

60 Days of Data Days! Live and on-demand sessions, challenges, study groups and more! And it's all FREE!. Join now. Learn more

Reply
vijaykaali811
Helper I
Helper I

pattern matching in ms access query

i have table T1 with  query, name 

T2  table pattern , category

Query  can be anything 

t2 table 

pattern2                     category

connection*failure*    connectivity 

power*failure*             power issue 

i am trying like 

select t1.query, t2.patter,t2.category  from t1,t2 where  query like "*"&t2.pattern2&"*"

but in MS access it says join does not suppport expression  . how to achieve this. 

 

 

 

3 REPLIES 3
Avyaktha
Frequent Visitor

hi vijaykaali811 

 

In MS Access, you can't use a pattern match (LIKE "*"&...&"*" ) as part of a join. Access doesn't allow expressions like that in joins.

But you can still do what you want by writing the query like this:

SELECT t1.query, t2.pattern2, t2.category
FROM t1, t2
WHERE t1.query LIKE "*" & t2.pattern2 & "*";

 

This is how it will work : 
It compares every row in t1 with every row in t2, and filters them where the pattern matches.

BUT If t2.pattern2 has * inside (like connection*failure*), that won’t work as you expect.
Access uses * as a wildcard, not as a separator. So instead you can store just simple text like connection or failure

Or split pattern2 into multiple columns if you want to check multiple words.

 

Thank you 
Avyaktha 

Shahid12523
Community Champion
Community Champion

In MS Access, you can’t use LIKE in the join.

Do this instead:

SELECT t1.query, t2.pattern2, t2.category
FROM t1, t2
WHERE t1.query LIKE "*" & t2.pattern2 & "*";


👉 Put LIKE in the WHERE clause, not the join.

Shahed Shaikh
v-lgarikapat
Community Support
Community Support

Hi @vijaykaali811 ,

 

Thanks for reaching out to the Microsoft fabric community forum.

 

Thanks for sharing your question here Since your issue seems to be related specifically to pattern matching in MS Access queries, I’d recommend also posting this thread in the Microsoft Access Community. There are many experienced Access developers and experts there who are more focused on Access-specific syntax and behaviour they may be able to offer more targeted assistance.

Database Software and Applications | Microsoft Access

 

Best Regards,

Lakshmi Narayana

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.

Top Solution Authors
Top Kudoed Authors