I did try to use COUNT(tbl_020articleDetails.articleID) AS  
totalArticles but came up with the error:

[Macromedia][SQLServer JDBC Driver][SQLServer]Column  
'tbl_020authorDetails.authorID' is invalid in the select list because  
it is not contained in an aggregate function and there is no GROUP BY  
clause.

<cfquery name="GetAuthors" datasource="user020" maxrows="8">
     SELECT
     tbl_020authorDetails.authorID,
     tbl_020authorDetails.authorFirstName,
     tbl_020authorDetails.authorSurname,
     tbl_020authorDetails.authorPhotograph,
     tbl_020authorDetails.authorAboutMe,
     COUNT(tbl_020articleDetails.articleID) AS totalArticles,
     tbl_020articleDetails.articleTitle
     FROM tbl_020articleDetails
     INNER JOIN tbl_020authorDetails ON  
tbl_020articleDetails.authorID = tbl_020authorDetails.authorID
     WHERE tbl_020authorDetails.authorPhotograph <> '' AND  
tbl_020articleDetails.articleSubTypeID <> 55
     ORDER BY tbl_020authorDetails.authorID
</cfquery>

<cfoutput query="GetAuthors" group="authorID">
<p><strong>#authorFirstName#</strong></p>

<p>my articles:</p>
<cfoutput>#articleTitle#<br /></cfoutput>
</cfoutput>


On 29 Sep 2005, at 13:30, Adrian Lynch wrote:

> You can't use COUNT in the ORDER BY clause. (Please someone back me  
> up here
> else I'm off to spend some time with Book Online!).
>
> Ade




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

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

Reply via email to