Hi Ian,
Here's an example of what you're trying to do. I tested this on a table of
mine, so the fields are a little different, but you'll get the idea.

<!---query for all dates, grouped by month--->
<cfquery name="test" password="#pword#" username="#uname#"
datasource="#dsn#">
SELECT datecollected, to_char(datecollected, 'MM') as themonth
FROM FLPWEB.CFS_LUNCHDATA
group by to_char(datecollected, 'MONTH'), datecollected
ORDER BY to_char(datecollected, 'MONTH'), datecollected
</cfquery>

<!---Set a default month--->
<cfparam name="defaultdate" default="10">

<!---Output the results for the default/selected month--->
<cfoutput query="test" group="themonth">
<cfif defaultdate IS themonth>
The Month: #monthasstring(defaultdate)#<BR>
<cfoutput>
Date: #datecollected#<br></cfoutput>
</cfif>
</cfoutput>

<!---Create a form with a drop-down box of all listed months--->
<form action="datetest.cfm" method="post">
<select name="defaultdate">
<option value="">Select another Month</option>
<cfoutput query="test" group="themonth">
<option value="#themonth#">#monthasstring(themonth)#</option></cfoutput>
</select>
<input type="submit" value="Go!">
</form>


Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]


______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to