Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
382 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

604 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