ASP does not provide a "Group By" equivalent to what is available in CF. You'll need to either build a VBScript function to do this or build it each time, storing the last value of the "Grouped" attribute and executing a sequence of code when it changes. Then your query would ORDER BY your grouped fields.
As Phil mentioned, the GROUP BY clause in a SQL statement is meant for use with aggregate functions... for example, if you wanted a total of all the votes cast for a person your sql might look like this: select count(vote_id) as vote_count, choice from votes group by choice order by choice Hope this helps point you in the right direction. Hatton -----Original Message----- Hi list, I want to do a GROUP BY statement in an ASP-Page. In CF I can do something like: <cfoutput query="foo1" group="foo2"> When I try to do this in ASP included in the SQL-statement I get an aggregate function error. (unfortunately in german, so it doesn't make sense to post). ______________________________________________________________________ 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 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists