Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
TheScarecrow #1
Date Range Search
I have a calendar search from where an option is to search between dates and
riight now it never finds anything. Do I need to do a format conversion? or
do I need to do something to the CFOUTPUT to get it to work? Any idea. thanks.
(MSACCESS db)
<cfapplication SESSIONMANAGEMENT = "Yes">
<cfif session.marker_find EQ 1>
<cfset session.marker_find = 0>
<cfif IsDefined("Form.description")>
<CFSET SESSION.Cf_description = FORM.description>
<cfelse>
<CFSET SESSION.Cf_description = " ">
</cfif>
<cfif IsDefined("Form.category")>
<CFSET SESSION.Cf_category = FORM.category>
<cfelse>
<CFSET SESSION.Cf_category = " ">
</cfif>
<cfif IsDefined("Form.months")>
<CFSET SESSION.Cf_month = FORM.months>
<cfelse>
<CFSET SESSION.Cf_month = " ">
</CFIF>
<CFIF IsDefined("Form.fromdate")>
<CFSET SESSION.CF_fromdate = FORM.fromdate>
<CFELSE>
<CFSET SESSION.Cf_fromdate = "">
</cfif>
<CFIF IsDefined("Form.todate")>
<CFSET SESSION.CF_todate = FORM.todate>
<CFELSE>
<CFSET SESSION.Cf_todate = "">
</cfif>
</cfif>
<CFQUERY NAME="calendarresult" DATASOURCE="source">
SELECT *
FROM event_cal
WHERE public=yes
<!---search by Description--->
<CFIF #SESSION.Cf_description# GT " ">
AND title LIKE '%#SESSION.Cf_description#%'
</CFIF>
<!---search by Category--->
<CFIF #SESSION.Cf_category# GT " ">
AND category = '#SESSION.Cf_category#'
</CFIF>
<!--- search by Month--->
<CFIF #SESSION.Cf_month# GT " ">
AND event_date LIKE '#SESSION.Cf_month#%'
</CFIF>
<!---search by Date Range--->
<CFIF #SESSION.Cf_fromdate# GT " " AND #SESSION.Cf_todate# GT " ">
AND event_date BETWEEN '#SESSION.Cf_fromdate#' AND '#SESSION.Cf_todate#'
</CFIF>
ORDER BY event_date
</CFQUERY>
TheScarecrow Guest
-
Date Range Validation
Hello; CL_FRST (08/10/2004) and CL_LST (05/24/2005) holds the beginning and ending date of school calendar which is also prepopulated for every... -
Date Range
I?ve got a routine that figure out 30 days from today?s date, but what I want to do is resolve a start date and an end date where the start date is... -
Newbie can't get date range search from form to work
Please help! I'm banging my head against a wall here. This is my first stab at ASP. I'm able to pass vars from a form to a search results page... -
Functional index in 9.30 not used for range search
Gabor Heppes wrote: I can't say that I've solved it, but it may be that the default cost of using the functional index is too high. If you... -
date range query
Hi I just need to pull up a query which will bring up orders between a specified date range say jan 2003/ july 2002 and from this I have to pull up... -
jorgepino #2
Re: Date Range Search
if your cf_month is eq MM and your event_date is eq to DD/MM/YY they will never equal
try this cf_month = #DatePart("m", event_date)#
jorgepino Guest
-
TheScarecrow #3
Re: Date Range Search
The month and date range search are seperate.
TheScarecrow Guest
-
tjfrevert #4
Re: Date Range Search
AND event_date BETWEEN #createODBCDate(SESSION.Cf_fromdate)# AND #createODBCDate(SESSION.Cf_todate)#
tjfrevert Guest



Reply With Quote

