ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Ordering two different ways based on date

December 09, 2008 8:32am

Subscribe [1]
  • #1 / Dec 09, 2008 8:32am

    nosidam

    9 posts

    Let me see if I can explain this properly…

    I have a list of events, and there are usually several events per day.  What I’m trying to do is display the events in a list ordered by the date of the event as a group in descending order (most recent first), then within that date, display them in ascending order (most recent last).  I’m using the date_heading variable to group entries by date without the time.

    Basically, I need it to look like the following:

    Dec. 8, 2008
    ——————
        Event 1
        Event 2
        Event 3

    Dec. 7, 2008
    ——————
        Event 1
        Event 2
        Event 3

    Dec. 6, 2008
    ——————
        Event 1
        Event 2
        Event 3

    The best I can do is to get the date correctly, but then the individual events are descending (i.e. event 3, event 2, event 1).

    Anyone know a way to accomplish this?  Perhaps I just need to do a SQL statement, but it’s too early for my brain to start on that.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases