Discussion Locked

Access Query

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm trying to write a query that will match on part of an user input string. Currently, I'm using [Enter search string] on the query. What I'd like is something that would work with the search string and hit on like matches. I figured I could use "Like "[Enter search string]"" but that didn't work.

Thanks for the help.

Mike

5 replies

by mbarker734

Continue with the [Enter search string] on your query.

Under the field you wish to be searched place the following in the Criteria:

Like '*'+ [Enter search string]+ '*'

This will cause the query to limit the result to only record that have the characters of the search string in the field being limited by the criteria. This is an open end match, the characters can be anywhere in the field but must be in the same order.

Good luck,

Mark

by quahsays

the current posting will work if the phrase appears as it is, but with embedded space, then you'll not get the match...
you might want to first check for a space, then put the first part and second word into separate variable, following the like statement, add firstword + "*" and "*" + secondword...so you might be able to return results of say "Tom Clancy", rather than having people to search for Tom or Clancy...

This discussion is closed to new replies.