I am not sure what you mean by OR. If you use
Where State in ('#yourList#')
it is like using a series of OR because as long as one record equals to
AZ, it will pick it up.
To exclude something, just use "where State not in"
Nathan Chen
-----Original Message-----
From: Torrent Girl [mailto:[EMAIL PROTECTED]
Sent: Friday, March 17, 2006 12:14 PM
To: CF-Newbie
Subject: Re: using Lists in Query
The problem is I need an OR statement.
I.e. Where state = AZ OR state = CA OR ....
This is where I am getting stumped.
How do I use a dynamic "OR" statement?
>You don't need the loop. Try:
>
><cfset myStates = "AZ,CA,CO,FL,ID,NM,NV,OR,UT,WA">
>
><cfoutput><pre>
> SELECT myField
> FROM myQuery
> WHERE State NOT IN (#ListQualify(myStates, "'")#)
></pre></cfoutput>
>
>Except get rid of the cfoutput's and pre's, they're just there just to
look
>pretty.
>
>Adrian
>
>-----Original Message-----
>From: Torrent Girl [mailto:[EMAIL PROTECTED]
>Sent: 16 March 2006 19:11
>To: CF-Newbie
>Subject: Re: using Lists in Query
>
>
>Actually, this help me add the ' ' and , but I still need to know how
to
>output the loop in the where clause.
>
>I can't get it to work right.
>
>
>
>
>
>>I found exactly what I needed at the following url:
>>
>>http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functb17.htm#wp
11078
>86
>>
>>SWEET! :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1716
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54