> Hi list, in my CFM Page I have a SQL-statement similar like > following: > > .. > SELECT make, reportYear, rating, comments > FROM carReportsTable > WHERE make IN (#url.makes#) > .. > > url.makes give me a list of items like: > > item1, item2, item3... > and those are coming from a checkbox called "makes" with > values like item1,item2,item3 (of a caller cfm-template). > The statement "WHERE make IN (url.makes)" is like a short > version of "Where make = item1 OR make = item2 OR make = > item3..." How can I change this OR to an AND ? > Is there a certain (different ?) SQL-function for this ?
If you're using SQL Server, you can use the ALL operator: SELECT ... FROM ... WHERE make = ALL (#URL.makes#) Since other people have suggested solutions that aren't specific to Transact-SQL, I'll omit those myself. There are probably alternatives to this syntax on other database platforms, as well. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ______________________________________________________________________ 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

