I may have made some little mistakes, but this should do it.  If you want to
do fancier formatting (e.g., tables or bulleted lists), you should be able
to use the same code with a little modification.

Hope this helps,
Matthieu

<CFSET Variables.LastMonth=0>
<CFOUTPUT query="qYear">

<CFSET Variables.CurrentMonth=Month(qYear.dtStartDate)>
<CFIF Variables.CurrentMonth is not Variables.LastMonth>
<HR><B>#MonthAsString(Variables.CurrentMonth)#</B>
</CFIF>
qYear.dtStartDate# - #qYear.dtEndDate#: #qYear.strEvent#
(#qYear.txtDescription#)<BR>
<CFSET Variables.LastMonth=Variables.CurrentMonth>
</CFOUTPUT>

-----Original Message-----
From: Cutter (CF_Talk) [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 10:50 AM
To: CF-Talk
Subject: Query Output


I have a function within a CFC that reads like this:

  <cffunction name="getCalendar" access="remote" output="false" 
returntype="query">
            <cfargument name="calendar" required="No" type="string" 
default="Full Year">
            <cfquery name="qYear" datasource="#application.stconfig.DSN#">
                    Select        i.dtStartDate,
                      i.dtEndDate,
                      i.strEvent,
                      i.txtDescription
          From        tblCalendarItems i,
                      tblCalendar c
          Where        c.strCalendarName = <cfqueryparam 
value="#arguments.calendar#" cfsqltype="CF_SQL_VARCHAR"> and
                  i.intCalID = c.intCalendar
          Order by    i.dtStartDate,
                      i.strEvent
                </cfquery>
            <cfreturn qYear>
        </cffunction>

A cfdump tells me that the query is returning the correct results. My 
question is this, how do I get my output to display like this:

February
<hr>
dd Event Name
dd Another Event Name

March
<hr>
dd And the Next Event
dd And Another

April
<hr>
dd And Even Another

If more clarification is needed let me know.

Cutter


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to