<cfset makes = ListToArray(url.makes)>
<cfquery>
        SELECT make, reportYear, rating, comments
        FROM carReportsTable
        WHERE make = makes[itr]
        <cfif ArrayLen(makes) gt 1>
                <cfloop index="itr" from="2" to="#ArrayLen(makes)#">
                        AND make = makes[itr]
                </cfloop>
        </cfif>
</cfquery>

-Matt

> -----Original Message-----
> From: cf-talk [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 11:48 AM
> To: CF-Talk
> Subject: OT: Where Columname IN-Question !
> 
> 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 ?
> 
> Thanks
> 
> Uwe
> 
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.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

Reply via email to