Using LIKE in SQL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi . Trying to set up a query for a user where the user can enter a portion
of the text and the query will go out and find every record that contains
that string of text.

In my query - (design view) - under the criteria section, I have :
Like [Find records like:] & '*'

This logic will return records ONLY where the BEGINNING of the value
searched is entered. Example: If the user keys in MED... this logic will
only return every record that BEGINS with MED. I want the logic to return
every record that contains MED...regardless if the record starts with MED or
MED is found in the middle of the string. (i.e. would want to find:
nonMEDical and MEDical)

Any suggestions? Am I missing something very obvious? THANK YOU
 
CAROL said:
Hi . Trying to set up a query for a user where the user can enter a
portion of the text and the query will go out and find every record
that contains that string of text.

In my query - (design view) - under the criteria section, I have :
Like [Find records like:] & '*'

This logic will return records ONLY where the BEGINNING of the value
searched is entered. Example: If the user keys in MED... this
logic will only return every record that BEGINS with MED. I want the
logic to return every record that contains MED...regardless if the
record starts with MED or MED is found in the middle of the string.
(i.e. would want to find: nonMEDical and MEDical)

Any suggestions? Am I missing something very obvious? THANK YOU

Like '*' & [Find records like:] & '*'
 
Hi Carol,

Yes, you're missing something obvious :) Try:
Like '*' & [Find records like:] & '*'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top