I have this query in a ColdFusion page:
<cfquery name="list_events" datasource="ksuperc">
SELECT DISTINCT
IIF (Month(event_date) BETWEEN 9 and 12,'FAL',
IIF (Month(event_date) BETWEEN 5 and 8,' SUM',
' SPR')) as event_semester,
year(event_date) as event_year
FROM events
</cfquery>
This query works fine except the output of this CFOUTPUT tag:
<table><cfoutput query="list_events"><tr><td>
#event_year# #event_semester#
</td></tr></cfoutput></table>
gives me this list:
2001 SUM
2001 FAL
2002 FAL
I want to run the dates descending. My question is how since ORDER BY won't work in DISTINCT? I searched through the forum and saw a whole lot of really complex statements, but i don't think this query needs to be terribly difficult.
Thanks in advance
-b-
<cfquery name="list_events" datasource="ksuperc">
SELECT DISTINCT
IIF (Month(event_date) BETWEEN 9 and 12,'FAL',
IIF (Month(event_date) BETWEEN 5 and 8,' SUM',
' SPR')) as event_semester,
year(event_date) as event_year
FROM events
</cfquery>
This query works fine except the output of this CFOUTPUT tag:
<table><cfoutput query="list_events"><tr><td>
#event_year# #event_semester#
</td></tr></cfoutput></table>
gives me this list:
2001 SUM
2001 FAL
2002 FAL
I want to run the dates descending. My question is how since ORDER BY won't work in DISTINCT? I searched through the forum and saw a whole lot of really complex statements, but i don't think this query needs to be terribly difficult.
Thanks in advance
-b-