?
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
Medium Priority
?
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
LambertHeenan earned 2000 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

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

777 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