Question
Substring in my query
In my form, I dynamicall generate a pulldown, for months
(1-Jan, 2-Feb, 3-Mar, etc.)
<select name="Month">
<option selected value="0">Scroll down to select month</option>
<cfoutput query="qryMonth">
<option value="#qrymoth.month#">#qrymonth.month#</option>
</cfoutput>
</select>
In my action page, for the query, I want to do something like this :
select substring(date_resolved,1,2) as month, substring(date_resolved,7,4) as year
where month = '#form.month#' and year = '#form.year#'
The date_resovled could be 1/1/2008 or 5/16/2008 (in the sql table)
When I use the substring to extract, am I getting one char for the month, or two (how would I know) ?
Also, it says the variable month is undefined.
What is the proper way to do this ?
Thanks
<select name="Month">
<option selected value="0">Scroll down to select month</option>
<cfoutput query="qryMonth">
<option value="#qrymoth.month#">#qrymonth.month#</option>
</cfoutput>
</select>
In my action page, for the query, I want to do something like this :
select substring(date_resolved,1,2) as month, substring(date_resolved,7,4) as year
where month = '#form.month#' and year = '#form.year#'
The date_resovled could be 1/1/2008 or 5/16/2008 (in the sql table)
When I use the substring to extract, am I getting one char for the month, or two (how would I know) ?
Also, it says the variable month is undefined.
What is the proper way to do this ?
Thanks
