>What would the best way to approach the following: > >I have a form field called "keywords" and would like to search for records >from the SQL 2K database from two columns EventTitle and EventDescription. >However, I need this to be case insensitive.. so that i I type mike or Mike >I will get the record if either mike or Mike is in either of the two >columns >in the DB? Right now I am trying to use > >form.keywords LIKE %EventTitle% and was thinking UCASE around the operands >would work. >
You're on the right track. For case-insensitive searching, surround both the DB column and the search term with the appropriate UCase or LCase function. For example, to search for "Mike", "mike", "mIkE", etc., just do: WHERE UPPER(firstname) LIKE %#UCase(form.searchword)#% Now, I put the % wildcard on both sides used like on the assumption that you wanted any instance of "mike" in a work. Obviously, you would tweak the wildcard use to your preference. Also, UPPER() is Oracle's function. In SQL Server, I know you can use StrConv([db_column],1), where "db_column" is the column name and 1 is the flag to convert to upper case, but there may be another function to do that as well. Hope this helps, Dave. _________________________________________________________________ Join the world�s largest e-mail service with MSN Hotmail. http://www.hotmail.com ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

