<cfquery name="PA_CT" datasource="phoenixart"> SELECT DISTINCT PA_COUNTRY, ID, PA_CATEGORY FROM papers GROUP BY PA_CATEGORY, ID, PA_COUNTRY </cfquery>
will work. I think that all of the columns in a select distinct need to be in the groupby also if I remember correctly. -----Original Message----- From: Les Mizzell [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 9:38 AM To: CF-Talk Subject: What the heck is wrong with this Query? Given a small Access database containing: ID, PA_COUNTRY, PA_CATEGORY <cfquery name="PA_CT" datasource="phoenixart"> SELECT DISTINCT PA_COUNTRY, ID, PA_CATEGORY FROM papers GROUP BY PA_CATEGORY </cfquery> I get the following error: You tried to execute a query that does not include the specified expression 'PA_COUNTRY' as part of an aggregate function. If I remove the "GROUP BY" - it works....but I need that in there! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

