Use CFQUERYPARAM with the 'list' attribute and it should work:

...
dealer_zip IN (<cfqueryparam cfsqltype="cf_sql_varchar"
value="#returnedzips#" list="true" />)

Just make sure that the zips in 'returnedzips' don't have truncated
leading zeros.

cheers,
barneyb

On Fri, 05 Nov 2004 19:51:24 -0400, Jeff Fongemie
<[EMAIL PROTECTED]> wrote:
> Hey everyone,
> 
> I have a table of zipcodes. I have the fieldtype as "interger" and my query works 
> fine:
> 
> <cfquery name="qry_get" datasource="#request.dsn#">
> Select * from dealers
> Where dealer_zip in ( #ReturnedZIPs#)
> </cfquery>
> 
> Except that as an interger field type, the leading zeros from the zipcodes are 
> removed. 01234 becomes 1234. My query works, but my display is off since the 
> zipcodes are truncated.
> 
> If I change my fieldtype to a text field, the zipcodes are left intact, however the 
> above query gets no returns.
> 
> By the way, #returnedzips# is a variable length list like 39485, 39485, 69685, 03295 
> etc.
> 
> Can my query be modified to allow me to change my fieldtype to text?
> 
> Any suggestions would be most welcome!
> 
> -Jeff
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

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