Hey eveyrone!
This should be simple - but for some reason I can't get this to work. I need to
get a list of dealers from the database ased on he "Territory" they are in. But
they Query is breaking... ?
Here is sort of what I am doing:
<cfset variables.StateList = "IA,IL,IN,MI,MN,MO,OH,WI">
<cfquery name="qryGetZipCodes" datasource="#Application.DSN#"
username="#Application.username#" password="#Application.password#">
SELECT id , dealer ,contact_person , contact_phone , address_1 ,
address_2 , city , state , province, country , zip , phone , toll_free , fax ,
website
FROM orig_dealers
Where orig_dealers.state IN (#variables.StateList#)
</cfquery>
Which produces the Query
SELECT id , dealer ,contact_person , contact_phone , address_1 , address_2 ,
city , state , province, country , zip , phone , toll_free , fax , website FROM
orig_dealers Where orig_dealers.state IN (IA,IL,IN,MI,MN,MO,OH,WI)
But it says I have an error in my Syntax...?
What am I missing here? It works if I use IDs - but not state. Can't I use
"text" for IN queries...?
Thanks in Advance!
- Nick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5817
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm