The Count function goes in the SELECT portion of your statement.

SELECT COUNT(tbl_020articleDetails.articleID) AS totalArticles

<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 28, 2005 2:34 PM
To: CF-Talk
Subject: Order by number of articles (count?)


Hi guys,

I'm trying to work out how to order my query by the amount of articles.

                 <cfquery name="GetAuthors" datasource="user020">
                 SELECT tbl_020authorDetails.authorID,
authorPhotograph, authorFirstName, authorSurname, authorAboutMe,
tbl_020articleDetails.articleID, tbl_020articleDetails.authorID,
articleTitle, articleDatePublishedLast
                 FROM tbl_020authorDetails, tbl_020articleDetails
                 WHERE authorPhotograph <> ' ' AND
tbl_020articleDetails.authorID = tbl_020authorDetails.authorID AND
tbl_020articleDetails.articleAuthenticated = 1 AND
tbl_020articleDetails.articleSubTypeID <> 55 AND
tbl_020articleDetails.articleSubTypeID <> 68
                 ORDER BY tbl_020authorDetails.authorFirstName,
articleDatePublishedLast DESC
                 </cfquery>

How do I count how many articles there are, ie something like ORDER
BY tbl_020articleDetails.articleID(Count as) or something?

Thanks for any help,

Saturday




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:219510
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to