I presume the design is based on one table for the event names and a
separate for instances of those events on a given date which seems
sensible.

Matt if you need the output based on the event names alphabetically
and then the dates desc in them then Jim/Kris code is great...

my assumption was that you wanted the events to output with the one
with that contained the farthest dates to appear first but grouped
with all other records with that event code within... but perhaps I
over-complicated what you actually need to achieve here !?

On 9/20/06, Rick Faircloth <[EMAIL PROTECTED]> wrote:
> I'll let the experts "enjoin" the fight about
>
>  the coding...but, I'm curious as to
> what type of application your coding for...a calendar and recurring events,
> or
> something else?
>
> I always put my event dates in the same table as the event ID,
> event name, etc....I was just wondering if I'm missing something...
> perhaps a coding practice I could employ...
>
> Rick
>
> -----Original Message-----
> From: Matt Williams [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 20, 2006 8:11 AM
> To: CF-Talk
> Subject: How to get these query results - Take 2
>
> I'm gonna try this again as while I slept last night my previous post
> turned into a discussion of SQL best practices and did not give the
> answer needed. But that's probably because I didn't explain well
> enough. Ordering by EventID will not work. Nor will ordering by date.
> Maybe a little more data will help.
>
> EventID, EventName
> 1 | TestEventOne
> 2 | TestEventTwo
> 3 | AThirdEvent
>
> EventID | EventDates
> 1 | 9/10/2006
> 1 | 9/20/2006
> 2 | 9/15/2006
> 3 | 9/30/2006
>
> <!--- Desired results --->
> AThirdEvent
>  9/30/2006
>
> TestEventOne
>  9/20/2006
>  9/10/2006
>
> TestEventTwo
>  9/15/2006
>
> If you order by EventID, you would get 1, 2, 3. If you ordered by Date
> DESC, you would get
> 3
> 1
> 2
> 1
> But I want the TestEventOne outputs to be together. GroupBy won't do
> it because you've ordered by date.
>
> This probably isn't possible without at least two queries, or at least
> some QofQ usage. I just can't seem to get my head around the solution
> though.
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253602
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to