mokaplanjr
Technical User
I need the users of a web to be able to query the database by entering a "From" date and a "To" date in text boxes. The table has two Date/Time fields called "EventStartDate" and "EventEndDate" which are filled by the web administrator in an HTML form using the dd/mm/yyyy format.
The Access 2000 db correctly recognizes the entries as dates (tested switching from Short Date to Long Date and back in Table view).
The best I can get (meaning no error codes) is the results page showing no results.
Here is the stuff.
1. The search form:
<form action="results.cfm" method="post"><input type="hidden" name="type" value="DateSearch">
SEARCH FROM THIS DATE
<input type="text" name="BeginDate" size="20">
TO THIS DATE
<input type="text" name="EndDate" size="20">
<input type="submit" value="SEARCH">
</form>
2. The results page (result.cfm"
<cfquery datasource="DB_DSN" name="Query" dbtype="ODBC">
SELECT * FROM Cal
WHERE EventStartDate <= #Form.BeginDate#
AND EventStartDate >= #Form.EndDate#
ORDER BY SecOrder ASC
</cfquery>
The idea is that if the event is in the db as starting on 3/2/2001 and ending on 3/3/2001 and I enter in the search fields (BeginDate) 3/1/2001 and (EndDate) 3/4/2001, this is should return the event since it falls inside the query dates.
What this gets me is a results page with no returns. The best I can find in going through all of the posts here is that date queries with CF is at best very difficult.
MO
The Access 2000 db correctly recognizes the entries as dates (tested switching from Short Date to Long Date and back in Table view).
The best I can get (meaning no error codes) is the results page showing no results.
Here is the stuff.
1. The search form:
<form action="results.cfm" method="post"><input type="hidden" name="type" value="DateSearch">
SEARCH FROM THIS DATE
<input type="text" name="BeginDate" size="20">
TO THIS DATE
<input type="text" name="EndDate" size="20">
<input type="submit" value="SEARCH">
</form>
2. The results page (result.cfm"
<cfquery datasource="DB_DSN" name="Query" dbtype="ODBC">
SELECT * FROM Cal
WHERE EventStartDate <= #Form.BeginDate#
AND EventStartDate >= #Form.EndDate#
ORDER BY SecOrder ASC
</cfquery>
The idea is that if the event is in the db as starting on 3/2/2001 and ending on 3/3/2001 and I enter in the search fields (BeginDate) 3/1/2001 and (EndDate) 3/4/2001, this is should return the event since it falls inside the query dates.
What this gets me is a results page with no returns. The best I can find in going through all of the posts here is that date queries with CF is at best very difficult.
MO