I didn't need to test whether or not the state was IN a list, I need to pull 
records based on each state but i wanted to make the query dynamic.

For instance, I you have a customer table and you want one query to give you 
the number of customers in each state, THEN you wanted to know how many brought 
shoes, how many brought a sweater, how many brught a bike, etc. etc. for each 
state. How would you make that dynanic - where you don;t have to do a query for 
each state/ for each item.

Hope that makes sense. :)

tGirl

P.S. Instead of my saying:

select * from GA where item = "sweater"
Select * from CA where item = "sweater"
Select * from NY where item = "sweater"

How can i do the above without having to write 50 queries for EACH item/state










>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?
>
>
>
>look
>to
>11078

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1728
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

Reply via email to