Skip to main content
September 4, 2008
Question

Still trying to find correct String Function for form search?

  • September 4, 2008
  • 1 reply
  • 537 views
A user enters first 3 letters of a word on a search form- the results need to include words which begin with them (e.g. "con" returns "Conajoharie" - not case sensitive).

Using MS Access.

SELECT myword
FROM theDB
WHERE upper(substr(myword,1, 3) = <cfqueryparam value="#ucase(form.keyword)#">

or

WHERE myword LIKE <cfqueryparam value="#form.keyword#*"> don't work

or

WHERE myword LIKE '%#form.keyword#' don't work

no luck so far...

Any help appreciated.



This topic has been closed for replies.

1 reply

Participating Frequently
September 4, 2008
For Access? Try....

SELECT myword
FROM theDB
WHERE LEFT(myword, 3) = <cfqueryparam value="#Left(form.keyword, 3)#">

Edit: Added CF Left() function to limit the length of form.keyword.

Phil
September 4, 2008
Phil:

That's it :>)

Thanks for your help...

newportri