Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2005



Tip: Looking for answers? Try searching our database.

Multiple criteria from a form field in to a quiry output

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fluiter - 29 Sep 2005 21:07 GMT
I've got an input form where i'm trying to sort dates in an output quiry.
The date out put should either list open, or closed, or all issue from the
database.
Here is the code from the input form. (dataSelection)
===========================
<form name="form1" method="post" action="output.cfm">
<p>&nbsp; </p>
<p> Select Region
<input type="radio" name="region" value="EMEA">
EMEA
<input type="radio" name="region" value="US">
US</p>
<p>Issue status
<input type="radio" name="date_closed" value="NULL">
Closed
<input type="radio" name="date_closed" value="NULL">
Open
<input type="radio" name="date_closed" value="">
ALL </p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>

And here is the code of the quiry i'm having sofar. (output)
========================================
<cfparam name="FORM.region" default="1">
<cfparam name="FORM.date_closed" default="1">
<cfparam name="PageNum_laden" default="1">
<cfquery name="laden" datasource="issue">
SELECT * FROM tbl_issue WHERE region IS '#FORM.region#'
AND date_closed >...............< here i'm lost..
</cfquery>
Dan Bracuk - 29 Sep 2005 22:57 GMT
Try this.  Make your buttons like this:
<input type="radio" name="date_closed" value="is NULL">
Closed
<input type="radio" name="date_closed" value="is not NULL">
Open
<input type="radio" name="date_closed" value="is null or is not null">

And in your query, do this
and date_closed #form.date_closed#
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.