This might not be the best solutions, but what if you did:

SELECT 
startdate, event_title,
( YEAR(startdate) ) AS event_year,
( MONTH(startdate) ) AS event_month,
( DAY(startdate) ) AS event_day
FROM events
WHERE active=1
ORDER BY startdate ASC


Then, on the output you could do a CFOutput and GroupBy the event year, then
month, then day? I rarely use the group by in Cfoutput, so not exactly sure
of the best methodology.
.......................
Ben Nadel 
www.bennadel.com
-----Original Message-----
From: Ray Champagne [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 20, 2006 10:13 AM
To: CF-Talk
Subject: grouping by date

I have an event table that I need to output the data in a specific fashion,
based on dates, like so:

April
        19th
                event1
                event2
                event3
        26th
                event4
                event5
        30th
                event6
                event7
                event8
May
        1st
                event10
                event11
        17th
                event12
                
June

etc

I have the date stored as a date type in the DB.  What's the best way to go
about outputting the events, grouped as above?  I've come up with some
elaborate workarounds, but they seem clunky and not very
maintenance-friendly.

For argument's sake, let's say the current select statement looks like this:

SELECT startdate, event_title
FROM events
WHERE active=1
ORDER BY startdate ASC

Thanks,

Ray



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238281
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to