Question
Date filter
I am using this code in my where statement to filter dates
between a "DateFrom" and "DateThru" session varriable. When I dump
the dates of both the session varriables and the Form dates, they
are correct and would seem to query the correct records. Here is
the code within the where statement.
<CFIF SESSION.EstimateLog.UserFilter IS NOT "">
AND (f.LastName LIKE '%#SESSION.EstimateLog.UserFilter#%' OR
e.Jobsite LIKE '%#SESSION.EstimateLog.UserFilter#%')
</CFIF>
<CFIF IsDate(SESSION.EstimateLog.DateFrom)>
AND e.BidDate >= #CreateODBCDate(SESSION.EstimateLog.DateFrom)#
</CFIF>
<CFIF IsDate(SESSION.EstimateLog.DateThru)>
AND e.BidDate <= #CreateODBCDate(SESSION.EstimateLog.DateThru)#
</CFIF>
If I have a BidDate is 12-8-08 and I enter in the form DateFrom=12-7-08 and DateThru=12-17-08 the query works. If I change the DateThru=1-8-09, the query doesn't display any records. The same thing happens if the DateFrom=11-30-08 and DateThru=12-9-08. What may be happening here. CFDUMP shows the correct dates.
<CFIF SESSION.EstimateLog.UserFilter IS NOT "">
AND (f.LastName LIKE '%#SESSION.EstimateLog.UserFilter#%' OR
e.Jobsite LIKE '%#SESSION.EstimateLog.UserFilter#%')
</CFIF>
<CFIF IsDate(SESSION.EstimateLog.DateFrom)>
AND e.BidDate >= #CreateODBCDate(SESSION.EstimateLog.DateFrom)#
</CFIF>
<CFIF IsDate(SESSION.EstimateLog.DateThru)>
AND e.BidDate <= #CreateODBCDate(SESSION.EstimateLog.DateThru)#
</CFIF>
If I have a BidDate is 12-8-08 and I enter in the form DateFrom=12-7-08 and DateThru=12-17-08 the query works. If I change the DateThru=1-8-09, the query doesn't display any records. The same thing happens if the DateFrom=11-30-08 and DateThru=12-9-08. What may be happening here. CFDUMP shows the correct dates.
