Thanks guys for the suggestion, 

I'll agree that the calculated column is probably my best bet, you're right
Charlie about that assuming the file extension is only 3 characters, however
two file extensions with the same last 3 characters isn't all that likely.

Now, I'm having a little trouble with this group by:

<cfoutput query="VARIABLES.Messages" group="type">
        #VARIABLES.Messages.type#
</cfoutput>

For some reason it doesn't appear to group properly, either that or I'm
forgetting how to use it properly :-D That code snippet outputs like this:

Gif
Jpg
Gif
Txt
Gif
Vcf

See how it's not grouping the gifs properly?

Any ideas what I'm missing?

Thanks guys,

Rob
-----Original Message-----
From: Brian Kotek [mailto:[EMAIL PROTECTED] 
Sent: 23 July 2007 16:24
To: CF-Talk
Subject: Re: GROUP BY RIGHT()?

No, but you could select a column in your query that reads just the first 3
characters of the filename, give it a column alias, order by that column
alias, and then use that in your cfoutput group attribute. Something like
this (check your particular RDBMS for the Right() function or similar):

select filename, right(filename, 3) as lastThreeFileName
from my table
order by lastThreeFileName

<cfoutput group="lastThreeFileName"></cfoutput>

On 7/23/07, Robert Rawlins - Think Blue
<[EMAIL PROTECTED]>
wrote:
>
> Hello Guys,
>
>
>
> I've got a query which returns a load of file names which I'm looking to
> group by their extension. Is there any way to do this dynamically from the
> name or do I have to make a separate column in the database?
>
>
>
> Can I do something like this:
>
>
>
> <cfoutput query="myquery" group="right(filename, 3)">
>
>                 #myquery.filename#
>
> </cfoutput>
>
>
>
> Thanks guys for any help, first time I've done any cf in a while, things
> are
> feeling a little rusty.
>
>
>
> Rob
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284365
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