Try this:
<!--- Set the CSS array --->
<cfset myCss = arrayNew(1) />
<cfset myCSS[1] = "eventWhite" />
<cfset myCSS[2] = "eventYellow" />
<cfset switch = 1 />
<!--- Get the data --->
<cfquery name="calendar">
SELECT
id, event_date, month(event_date) as theMONTH, event_name, event_pic
FROM stpaul_events
WHERE month(event_date) >= #month(now())#
and month(event_date) < #threemonths#
ORDER BY event_date ASC
</cfquery>
OUTPUT BLOCK
<!--- Default the previous day to the first returned item --->
<cfparam name="prevDay"
default="#LSDateFormat(calendar["event_date"][1], 'mm/dd/yyyy')#" />
<!--- Output the data --->
<cfoutput query="calendar" group="theMONTH">
<h4>#LSDateFormat(calendar.event_date,'MMMM - YYYY')#</h4>
<div id="eventBODY">
<cfoutput>
<cfif (LSDateFormat(calendar["event_date"][currentRow],
'mm/dd/yyyy') neq prevDay)>
<!--- If the current day is not equal to the prevDay
--->
<cfset prevDay =
LSDateFormat(calendar["event_date"][currentRow],
'mm/dd/yyyy') />
<cfset switch = (2 - switch) + 1 />
</cfif>
<div class="#myCSS[switch]#">
#LSDateFormat(calendar["event_date"][currentRow], 'mm/dd/yyyy')# -
#myCSS[switch]# - Lots of stuff here - </div>
</cfoutput>
</div>
</cfoutput>
If your event_date is just a date and not a date/time then you can
change the cfif to just check if the date is not the same <cfif
calendar["event_date"][currentRow] neq prevDay> and default prevDay to
the first event_date returned.I used the LSDateFormat function because
you want to remember the date not the day since if you have two
consecutive events on the same day of the month the two sections would
be highlighted the same color (note: dayofweek and dayofyear suffer
from the same problem, just trying to cover all bases ;-))
HTH.
--
Donnie Bachan
Website: http://www.islandwizards.com
Blog: http://angrytrini.blogspot.com
"Nitendo Vinces - By Striving You Shall Conquer"
======================================================================
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200375
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54