In other words...and yes by all means <cfqueryparam>
<cfif form.states neq "0"> <!---assuming the value is "0" in your option for all states---> where s.stateID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#form.stateID#"> </cfif> Doug B. ----- Original Message ----- From: "Pete" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Thursday, January 18, 2007 7:02 PM Subject: Advanced Search > Hi all > > I'm trying to finish something and its just not working. > > Here is what I am trying to do > > Display to a user a list of states in a drop down menu where they can either > select an individual state or they can select All States. > > If they select an individual state everything works fine. > > If they don't select anything or select ALL STATES then I am receiving an > error. > > Here's the code I am using for the search: > > <cfquery name="qGetAdvertisers" datasource="#request.db_dsn#" > username="#request.db_login#" password="#request.db_pwd#"> > select * > from tbl_advertisers a, tbl_procedures p, tbl_advertiserprocs ap, > tbl_advertiserstates r, tbl_states s > where a.advertiserid = ap.advertiserid > and a.advertiserid = r.advertiserid > and p.procedureid = ap.procedureid > and s.stateid = r.stateid > AND p.procedureid=#form.procedureid# > AND s.stateid=#form.stateid# > </cfquery> > > I know I am missing something but just not thinking. > > > > > > > > > Archive: > http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266948 > Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm > Unsubscribe: > http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=22600.17148.4 > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266955 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

