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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfsearch, explicit syntax

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can someone please clearify something for me?
I have the following data
FirstName LastName telephone adress
1.Jenny Smith 411 1234 Jenny street
2.Karen Benson 511 4553 Jenny Street
3.Jenny Roberts 611 13432 George Ave

I have the following code.

<cfquery datasource = &quot;something&quot; name=&quot;other&quot;>
Select firstName, lastName, telephone, address
From CustomerTable
</cfquery>

<cfindex collection=&quot;example&quot; action=&quot;Refresh&quot; type=&quot;Custom&quot; title=&quot;test&quot; Key=&quot;lastName&quot; body=&quot;firstName,lastName,telephone,address&quot; query=&quot;other&quot; custom1=&quot;firstName&quot; custom2=&quot;lastName&quot;>

<cfsearch Name=&quot;searchInfo&quot; collection=&quot;example&quot; type=&quot;Explicit&quot; criteria=&quot;CF_CUSTOM1 <SUBSTRING> Jenny&quot;>

I thought the above cfsearch statement should only return records that contains &quot;Jenny&quot; in the firstName field, in the above case, it should return record 1 and record 3. However, when I use it, it returns record(s) that contains &quot;Jenny&quot; in firstName, lastName, telephone or address, in the above case records 1, 2 and 3.

Can someone please help me out. What should I do, if I only want record(s) that contains &quot;Jenny&quot; in the lastName (custom1) field. In the above case, only return record 1 and 3. Not record 2, since Jenny is not in the firstName field.

Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top