first letter of the search string. Just be sure to notify users of the
functionality of your search engine.
"Please enter in the first few letters of the last name of the person you
wish to find"
You could also provide two radio buttons to allow them to search first or
last names. Anything could work as long as your UI provides enough
instruction for the user to follow.
SELECT p.first_name, p.last_name, p.person_id
FROM person p
<cfif form.name_to_search eq "last">
WHERE p.last_name LIKE '#form.last_name#%'
<cfleseif form.name_to_search eq "first">
WHERE p.first_name LIKE '#form.first_name#%'
</cfif>
ORDER BY p.last_name
<cfoutput query="yourQuery">
<a href=""> #first_name#</a><br>
</cfoutput>
________________________________
From: Claremont, Timothy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 28, 2004 11:47 AM
To: CF-Talk
Subject: Select Box / LIKE operator
I need to come up with a "search" function that will return a list of
matches for a given input.
The fields in question are "FirstName" and "LastName".
I am not averse to having the search work simply on the last name. For
our purposes this is sufficient.
The backend database is Access, so I would like to know what my SQL
would look like in order to be most useful.
If the end user just enters "e" in the search box, I am not so sure that
I want every name that contains an 'e' to be returned.... Or do I???
What is the consensus on how to make something like this work best?
TIA,
Tim
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

