Solved

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

Posted on 2011-09-12
3
350 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:Rex85
3 Comments
 
LVL 11

Accepted Solution

by:
LambertHeenan earned 500 total points
ID: 36524301
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36524302

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
 

Author Closing Comment

by:Rex85
ID: 36524532
thanks!. I just needed the simpler version to make it work.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question