Yup. Adding the field to the SELECT did the trick. Thanks.
----- Original Message ----- From: "Greg Cerveny" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Wednesday, February 02, 2005 12:44 PM Subject: Re: SQL: ORDER BY when using DISTINCT > Hey Jim, > > Is that an ms access database? I ran into that issue before where you > had to have anything in order by stated in the select statement. The > same SQL statement did however work with MS SQL. I ended up having to > rewrite my query using aggregate functions and a group by. > > > On Wed, 2 Feb 2005 10:22:32 -0700, Jim McAtee <[EMAIL PROTECTED]> > wrote: >> What can I do to sort this query by skiareas.name? I get an error that >> the ORDER BY conflicts with the DISTINCT when I add "ORDER BY a.name". >> >> SELECT DISTINCT c.areacode >> FROM snowconditions c INNER JOIN skiareas a ON a.areacode = c.areacode >> WHERE a.state = '#attributes.state#' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:192796 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