Is it the "OR" dangling off the end of the last zip code? If so, you could
add 1=0 after the </cfloop> or use something more elegant like ...

dealer_zip IN (<cfqueryparam value="#ReturnedZIPs#"
cfsqltype="CF_SQL_INTEGER" list="Yes">)

> -----Original Message-----
> From: Jeff Fongemie [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, 26 October 2004 1:53 p.m.
> To: CF-Talk
> Subject: Query -looping through a list
> 
> What's wrong with this code?
> 
> <cfquery name="qry_getdealers" 
> datasource="#Application.DSN#"> Select * from Dealers Where 
> <cfloop index="zip" LIST="#ReturnedZIPs#" DELIMITERS=","> 
> dealer_zip ='#zip#' or </cfloop> </cfquery>
> 
> I get a list of zipcodes. I need to get all the dealers that 
> have match any one of zipcodes from my list.  
> 
> I must be missing something simple!
> 
> -Jeff
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182560
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to