Ask a Question related to Coldfusion Database Access, Design and Development.
-
fluiter #1
Multiple criteria from FORM field in a quiry
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> </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>
fluiter Guest
-
Multiple search criteria with empty field option
Hi guys! I know I am being dumb here but running out of ideas. I am a newbie to php and mysql and progressing quite well. However, I am currently... -
Remove form field duplicated across multiple pages
Can a (text) form field duplicated across multiple pages in Acrobat 6.0.1 be removed in a simple operation, or must the field be removed from each... -
form: single line -- multiple text boxes -- one typing field - how?
please excuse my ignorance. am a newbie. I saw a fillable form, that shows:- a single line with multiple text boxes for entering each letter of a... -
#25421 [Bgs->Opn]: $_POST doesn't show the value of select form field when multiple=true
ID: 25421 User updated by: khalid_kary at hotmail dot com Reported By: khalid_kary at hotmail dot com -Status: Bogus... -
Criteria/Field Problem
Hello, I've done all the complicated stuff just fine, and now I have one simple task left. Of course it's the "simple" thing that has me stopped in... -
mxstu #2
Re: Multiple criteria from FORM field in a quiry
I'm guessing
A) if an issue is "Closed" the date column value will not be NULL
B) if an issue is "Open" the date column value will be NULL
C) if the selected issue type is "ALL" then you want to ignore the date column?
If this is what you want, try setting the value of the radio button to
"closed", "open" and "all". Then on your action page:
<!--- not tested --->
<cfparam name="FORM.date_closed" default="all">
<cfquery name="laden" datasource="issue">
SELECT * FROM tbl_issue
WHERE region IS '#FORM.region#'
<cfif trim(form.date_closed) eq "closed">
AND date_closed IS NOT NULL
<cfelseif trim(form.date_closed) eq "open">
AND date_closed IS NULL
</cfif>
</cfquery>
mxstu Guest



Reply With Quote

