Adrian Lynch wrote: > You need to include the other columns in your SELECT in your GROUP BY > clause.
When I do that, the group count is always "1" I'm using a second query right now, but there's got to be a more compact way... >> -----Original Message----- >> From: Les Mizzell [mailto:[email protected]] >> Sent: 05 May 2009 16:56 >> To: cf-talk >> Subject: Getting a count from a group in cfquery >> >> >> What I'm trying to get: >> >> <cfoutput query="thisLOG" group="groupID" /> >> #thisCOUNT# emails sent on #thisLOG.emailDATE# >> <cfoutput> >> #thisLOG.emailADDRESS#<br> >> </cfoutput> >> </cfoutput> >> >> "thisCOUNT" above would be the number of emails in a particular group >> >> >> Here's what I want to do in my query - but errors work since everything >> isn't included in a scalar function. I'm using SQL Server >> >> SELECT >> COUNT(groupID) as thisCOUNT, >> emailID, >> emailADDRESS, >> emailDATE, >> groupID >> FROM log_email >> WHERE emailID = <cfqueryparam value="#trim(url.emailID)#" >> cfsqltype="CF_SQL_INTEGER" /> >> GROUP BY groupID >> ORDER BY emailDATE desc >> >> >> Haven't found a way to correct this yet that works. Suggestions please? >> >> TIA! > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322185 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

