hm, no.  You could how ever add a count column to your query, either via grouping or 'subselect' then use that number or you can setup a counter in the cfoutput loop.  What sort of table are you trying to build?   The below builds a table.  

<table bored="1">
<cfoutput query="foo" group="category">  
<tr>
   <td colspan="5">#foo.category# </td>
</tr>
   
<cfoutput>
   <tr>     
      <td>#foo.filename#</td>
      <td>#foo.othercolumn#</td>
    </tr>  
</cfoutput>
</cfoutput>
</table>

Doug
-----Original Message-----
From: Mickael Elmalem [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 10, 2004 5:47 AM
To: CF-Talk
Subject: Re: Sorting for Reports

Thanks Doug,

That helped a lot.  Now I have another question.  The layout looks great but it is in a vertical listing I would like to make some tables.  Is there a way to determine the recordcount in each category?  Like query.recordcount just for the group="category" part of my CFQuery?

Mike

> get the category for every row as you are doing, order by this
> category, then use the group attribute in cfoutput

>
> <cfoutput query="foo" group="category">
  
> #foo.category# </br>
   
> <cfoutput>
        
> #foo.filename#</br>
   
> </cfoutput>
> </cfoutput>

>
> something like that

>

>
> Doug
>
> -----Original Message-----
> From: Mickael Elmalem [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 09, 2004 5:23 PM
> To: CF-Talk
> Subject: Sorting for Reports
>
>
> Hello All,
>
> I need to create a page that displays files(viewlets) uploaded by
> users, by category.  The users can create categories on their own then
> the files get bound to that category.  I have that part working fine.
>
> My issue is the display  I have one table that has two columns,
> categoryID and Category and another table that has
> The filename, categoryid, and a friendly filename
>
> Here is my SQL statement  
>
> SELECT ViewletCategory.Category, Viewlets.FileName, Viewlets.
> ViewletName
> FROM ViewletCategory INNER JOIN Viewlets ON ViewletCategory.CategoryID
> = Viewlets.Category;
>
> The display issue that I am having is I would like to show the
> category only as a heading once then list the files associated to that
> category below.
>
> Then the next category as a heading then all the files associated
> below.
>
> But what I am getting from my query is the category for everyrow, this
> is not what I want.  Could someone point me in the right direction.
>
> Thanks
>
> Mike
>
> Then show the
  
> _____  
>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to