I am trying to create form where I can search between two dates of my Date field (submitDate).
The two values below (dateOne and dateTwo) are not database fields. I am using them just to pass values for my Beginning and Ending date.
My form:
My action page:
Please advise why this is not working:
The two values below (dateOne and dateTwo) are not database fields. I am using them just to pass values for my Beginning and Ending date.
My form:
Code:
<form action="action7.cfm" name="search7" method="post">
Name<input type="Text" name="name">
<br><br>
Beginning Date<input type="Text" name="dateOne">
End Date<input type="Text" name="dateTwo">
<input type="submit" name="submit">
</form>
My action page:
Code:
<cfquery name="theRecord" datasource="theDSN">
SELECT *
FROM TableOne
WHERE 0=0
<cfif len(trim(FORM.name))>
AND name LIKE '%#form.name#%'
</cfif>
AND submitDate Between #FORM.dateOne# And #FORM.dateTwo#
</cfquery>
Please advise why this is not working: