Querying "LIKE"

S

Suzette

I'm using the LIKE keyword for looking up information in a table in my SQL
statement. The problem is when my user enters "Thomas Smith" and the entry
in the database is "Thomas A Smith". I'm wondering if there is any simple
way around it without having parse the words and write SQL statements after
parsing.

Any suggestions or links to hints would be thoroughly appreciated.

Thanks

Suzette
 
K

Ken Snell [MVP]

This will find that record:

WHERE [Fieldname] Like "Thomas*Smith"

Now, the trick will be to take your user's input and insert appropriate
wildcards. Perhaps, if you tell your user to just enter the first part of
the name:

WHERE [Fieldname] Like "Thomas*"
 

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

Top