I've been having a problem with an events display page for a college performing group. We want to sort the records by semester and year from the date field and that's been taken care of. The problem is displaying them dynamically.
Here's the query:
<cfquery name="events2" datasource="ksuperc" debug>
SELECT * FROM events WHERE month(event_date)
<cfif url.sem IS 1>
BETWEEN 9 AND 12
<cfelseif url.sem IS 2>
BETWEEN 5 AND 8
<cfelse>
BETWEEN 1 AND 4
</cfif>
AND (year(event_date) = '#url.yr#')
</cfquery>
This query only returns a recordcount for the Summer semester (url.sem = 2.) The Fall and Spring semesters (url.sem = 1 and the cfelse statements respectively) are not retunring any records even though there are records that should be displayed for Spring and Summer 2003, Fall 2002, Summer and Fall 2001.
There's got to be a way to make this query work, isn't there? Thanks in advance...
-b-
Here's the query:
<cfquery name="events2" datasource="ksuperc" debug>
SELECT * FROM events WHERE month(event_date)
<cfif url.sem IS 1>
BETWEEN 9 AND 12
<cfelseif url.sem IS 2>
BETWEEN 5 AND 8
<cfelse>
BETWEEN 1 AND 4
</cfif>
AND (year(event_date) = '#url.yr#')
</cfquery>
This query only returns a recordcount for the Summer semester (url.sem = 2.) The Fall and Spring semesters (url.sem = 1 and the cfelse statements respectively) are not retunring any records even though there are records that should be displayed for Spring and Summer 2003, Fall 2002, Summer and Fall 2001.
There's got to be a way to make this query work, isn't there? Thanks in advance...
-b-