Adobe Community
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
ShowÂ
 onlyÂ
|
Search instead forÂ
Did you mean:Â
Global community
Language:
Deutsch
English
Español
Français
Português
日本語コミュニティ
Dedicated community for Japanese speakers
í•œêµ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Sign In
Exit
Home
ColdFusion
Discussions
Find first 3 letters with Form search?
Home
ColdFusion
Discussions
Find first 3 letters with Form search?
0
Upvote
Find first 3 letters with Form search?
newportri
New Here
,
/t5/coldfusion-discussions/find-first-3-letters-with-form-search/td-p/151988
Sep 03, 2008
Sep 03, 2008
Copy link to clipboard
Copied
Greetings
I have a search form in which the user types the first 3 letters of a word - the results should display only those words that begin with the letters.
What would the correct SQL format be to accomplish this?
WHERE myword LIKE '%#Trim(FORM.Keyword)#%' ?
Thanks in advance.
TOPICS
Advanced techniques
Views
625
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
5 Replies
5
Jump to latest reply
Dan_Bracuk
LEGEND
,
/t5/coldfusion-discussions/find-first-3-letters-with-form-search/m-p/151989#M13874
Sep 03, 2008
Sep 03, 2008
Copy link to clipboard
Copied
if your db support it,
where upper(substr(myword,1, 3) = <cfqueryparam value="#ucase(form.keyword)#">
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
newportri
AUTHOR
New Here
,
/t5/coldfusion-discussions/find-first-3-letters-with-form-search/m-p/151990#M13875
Sep 03, 2008
Sep 03, 2008
Copy link to clipboard
Copied
In Response To Dan_Bracuk
Thanks again for your quick response, Dan.
Here is the error message I am getting (MS Access DB):
Error Executing Database Query.
Missing ), ], or Item in query expression 'upper(substr(vendor_company,1, 3) = ?'.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
newportri
AUTHOR
New Here
,
/t5/coldfusion-discussions/find-first-3-letters-with-form-search/m-p/151991#M13876
Sep 03, 2008
Sep 03, 2008
Copy link to clipboard
Copied
In Response To Dan_Bracuk
Sorry- I did add the extra ")" and now get:
Error Executing Database Query.
Undefined function 'upper' in expression.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Dan_Bracuk
LEGEND
,
/t5/coldfusion-discussions/find-first-3-letters-with-form-search/m-p/151992#M13877
Sep 03, 2008
Sep 03, 2008
Copy link to clipboard
Copied
Functions vary with the db.
Since you are using access, open it up and see where the f1 key leads you. Or, google "ms access string functions".
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
darbus23
Explorer
,
/t5/coldfusion-discussions/find-first-3-letters-with-form-search/m-p/151993#M13878
Sep 03, 2008
Sep 03, 2008
Copy link to clipboard
Copied
LATEST
In Response To Dan_Bracuk
just do...
WHERE myword LIKE <cfqueryparam value="#form.keyword#*">
There shouldn't be a need to do any string functions because MS Access queries are not case-sensitive.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Â
Resources
Documentation
ColdFusion User Guide