Add something like the following to your query:
<cfif IsDefined("yourCheckbox")>
AND theColumn = 1
</cfif>
Adrian
> -----Original Message-----
> From: Sin Tec [mailto:[email protected]]
> Sent: 05 March 2009 17:44
> To: cf-talk
> Subject: Query based on Checkbox clicked/unclicked
>
>
> Im trying to output a query based on criteria passed from a form and
> having a brain fart.
>
> Users sign up and are able to check if they want to recieve the
> newsletter or not. If so a 1 is put in the newsletter row in the table.
> Im creating a search form where I can output them all but then I can
> filter the output by searching the username, name, if they signed up
> for the newletter and/or signed up for promos.
>
> <cfquery name="qListeners" datasource="#request.dsn#">
> SELECT *
> FROM dbo.#stationName#_listener_list
> Where username LIKE <cfqueryparam value="%#form.keyword#%"
> cfsqltype="cf_sql_clob">
> OR name LIKE <cfqueryparam value="%#form.keyword#%"
> cfsqltype="cf_sql_clob">
>
> </cfquery>
>
> Above works for username and/or name. How can I add the abbility to if
> the checkbox is not checked then it pulls both signedup and not signed
> up but then if its checked to pull in people that are signed up?
>
> Cheers
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320146
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4