<cfquery name="qNewsList" datasource="#request.dsn#">
SELECT eventdate, eventtitle, location
FROM events
WHERE eventdate > <cfqueryparam cfsqltype="CF_SQL_DATE" 
value="#Now()#">
ORDER BY eventdate ASC
</cfquery>
<table>
<cfoutput query="qNewsList">
        <cfif Month(qNewsList.eventdate) NEQ thisMonth>
                <tr class="monthtitle">
                        <td
colspan="2">MonthAsString(qNewsList.eventdate)</td>
                </tr>
                <cfset thisMonth = Month(qNewsList.eventdate)>
                <cfset class = "menu2">
        </cfif>
        <cfif class IS "menu1">
                <cfset class = "menu2">
        <cfelse>
                <cfset class = "menu1">
        </cfif>
        <tr class="#class#">
                <td>#DateFormat(qNewsList.eventdate)#</td>
                <td>#qNewsList.eventtitle#<br>#qNewsList.location#</td>
        </tr>
</cfoutput>
</table>

Pascal Peters
Macromedia Certified Instructor
Certified ColdFusion (5.0) Advanced Developer
LR Technologies, Belgium
Tel     +32 2 639 68 70
Fax     +32 2 639 68 99
Email   [EMAIL PROTECTED]
Web     www.lrt.be


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 9 november 2001 12:02
To: CF-Talk
Subject: How can this be implemented ?


Hi 


I currently have a What's On Guide that is currently static html pages,
but I intend to make this database driven using Coldfusion.

I want to display the following fields from my db table, Eventtitle,
eventdate, and location which has already been set up and polulated with
some sample data.

These display event information for the forthcoming months,

Looking at the graphic example attached which shows a design mock up of
how it should look when fully working with Coldfusion,

How would you break the events (fields from the database) sorted by
month so you display November and all of novembers months are displayed,
then if
there are entries for December , the December title is displayed and
decembers events etc.

Finally how would you be able to make the table cell rows alternate
colors such as in the example attached for each record?

Any ideas on the best possible solution/ implementation with CF would be
appreciated.

Ian


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to