In Access SQL, How Can I make A Query that Selects Records that Contain All or Part of a String

I need a Query with a WHERE Clause that picks up on strings, or parts of a string, in a field that may contain multiple text strings besides the ones I am trying to selectively choose.
RexQuality LeaderAsked:
Who is Participating?
 
LambertHeenanCommented:
If I understan the question correctly, you have a text field that may contain lots of data, say "Your assistance is requested for the following question. It has been marked as neglected and is now eligible for bonus points" and you need a query that will find records that have, for example, the phrase "is requested", ragardless of what else is in the field.

If so, then assuming the field is called txtInfo, and the table is called Table1, the SQL would be

Select * from Table1 Where txtInfo Like "*is requested*".

Or if the data is actually soted in SQL Server...

Select * from Table1 (Where txtInfo Like "%is requested%".
0
 
Rey Obrero (Capricorn1)Commented:

you can try this


Where [field] like "*" & yourstring & "*"


in QBE design

Field      [FieldName]
Table

Criteria  like "*" & yrString & "*"





or

Field      [FieldName]
Table

Criteria  like "*" & [Enter String] & "*"

0
 
RexQuality LeaderAuthor Commented:
thanks!. I just needed the simpler version to make it work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.