Hello, I'm trying to create a form that allows the user to select a date range
(Start and End Date). Then populate the data in a CFGrid based on the selected
date range. I am able to get the date selection part, but not sure what to do
next for the CFGrid.

Mainly my Query will look something like this,

select * from Temp where Date >= "#form.StartDate#" and Date <"#form.EndDate#"

I get error message saying it does not recognize the Form.StartDate and
Form.EndDate. This is my Code. Any help wuld be great.

<CFFORM Name="Form" Format="Flash" Width="95%" Height="700"
style="themeColor:##56A1E1; marginRight:0; background-color:##37749D;">
<cfparam name="Form.startdate" default="#dateformat(now()-5, 'mm/dd/yyyy')#">
<cfparam name="Form.enddate" default="#dateformat(now()-1, 'mm/dd/yyyy')#">
<cfparam name="Form.selectdate" default="#dateformat(now(), 'mm/dd/yyyy')#">
<cfparam name="Form.outdate" default="#dateformat(now()+2, 'mm/dd/yyyy')#">

<CFFORMGROUP Type="hBox" Height="590">
<cfformgroup type="panel" height="436" style="indicatorGap:0; verticalGap:5;
headerColors: ##AE0C0A, ##8C0A08;" label="Search">
<CFFORMGROUP type="VBox" width="33%">
<cfformitem type="text" style="fontWeight:bold;" >Check In Date:</cfformitem>
<cfcalendar name="selectedDate"
selectedDate="#Form.selectdate#"
startRange="#Form.startdate#"
endRange="#Form.enddate#"
mask="mm/dd/yyyy"
dayNames="SU,MO,TU,WE,TH,FR,SA"
monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"
style="rollOverColor:##FF0000"
width="200" height="150" >
<cfformitem type="text" style="fontWeight:bold;" >Check Out
Date:</cfformitem>
<cfcalendar name="OutDate"
selectedDate="#Form.outdate#"
startRange="#Form.outdate#"
endRange="#Form.enddate#"
mask="mm/dd/yyyy"
dayNames="SU,MO,TU,WE,TH,FR,SA"
monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"
style="rollOverColor:##FF0000"
width="200" height="150" >
</CFFORMGROUP>
</CFFORMGROUP>


<cfformgroup type="panel" height="436" style="indicatorGap:0; verticalGap:5;
headerColors: ##AE0C0A, ##8C0A08;" label="Result">
<CFFORMGROUP type="VBox">
<cfformitem type="text" style="fontWeight:bold;" >Select Date</cfformitem>
<cfformitem type="text" name="D1" bind="Check In:
{Form.selectedDate}"></cfformitem>
<cfformitem type="text" name="D2" bind="Check Out:
{Form.OutDate}"></cfformitem>

</CFFORMGROUP>
</CFFORMGROUP>

<cfformgroup type="panel" height="436" style="indicatorGap:0; verticalGap:5;
headerColors: ##AE0C0A, ##8C0A08;" label="Search">
<cfformgroup type="horizontal">
<cfquery name="Lookup" datasource="Jimmy">
Select * from Temp where Date >= "#D1#" and Date < "#D2#" group by Cat_Code
</cfquery>

<CFgrid name="qwerty" Query="Lookup">
<CFgridcolumn name="Description" Header="Description">
</CFgrid>
</cfformgroup>
</CFFORMGROUP>

</CFFORMGROUP>
</CFFORM>