Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the "Like" Function

Status
Not open for further replies.

bigmerf

MIS
Joined
Oct 4, 2002
Messages
247
Location
US
I'm trying to use a "Like" function to do searches on different fields for different records. For example, I have three fields (A, B & C).

I want to be able to prompt my users with a parameter that asks: "Enter the keyword(s) you wish to search for."

Whatever the users enters, I want to store that within the parameter. Next I want to then take that parameter and compare the value versus the three fields (A, B & C). If the keyword is found in any of the three fields, then print that record.

I was able to set up the parameter just fine, but when trying to set-up the "Like" function I keep getting errors. I'm trying to set-up a selection sort, and this is what I have so far:

{TableA.Field A} = Like("*"{?Parameter}"*")

In other words I want all records that have the keyword(s)anywhere in Field A. I keep getting compile errors.

Can anyone help with this??
 
Assuming your paramter is a string value, change it to this

{TableA.Field A} Like "*"+{?Parameter}+"*"


-LW
 
WLTC:

"Like" and "=" are similar functions and should not be used together. In other words "Like" replaces "=" when doing 'wildcard' searches or joins.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top