Athelene, Copy/paste this into a CFM page and hit it with a browser...
You may like what you see. :) J <cfset myString = "AUTHOR='GIESEMAN','SMITH', ABSTRACT='CAT','DOG','FISH'"> <cfset myString = replace(myString,", ","||","all")> <cfset listOne = listFirst(myString,"||")> <cfset listTwo = listLast(myString,"||")> <cfset listOneEnd = listLast(listOne,"=")> <cfset listTwoEnd = listLast(listTwo,"=")> <pre> <cfoutput> select * from tbl_whatever where lastname in (#listOneEnd#) and abstract in (#listtwoend#) </cfoutput> </pre> On 4/15/05, Gieseman, Athelene <[EMAIL PROTECTED]> wrote: > I have a text field that contains saved search criteria. The field is > called CRITERIA. I need to take the criteria in the field and make a valid > SQL query out of it. For example, I have a record in the table that has the > following in the CRITERIA field: > > My string is: AUTHOR='GIESEMAN','SMITH', ABSTRACT='CAT','DOG','FISH' > > I want to find all the records that have either GIESEMAN or SMITH as the > author AND where abstract contains either CAT, DOG or FISH. > > How can I auto-magically parse the string into a valid SQL query? > > Athelene Gieseman > > Chief Information Officer > > Stinson Morrison Hecker > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> -- Continuum Media Group LLC Burnsville, MN 55337 http://www.web-relevant.com http://www.web-relevant.com/blogs/cfobjective ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203138 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

