CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Group by doesn't work

Print topic Send  topic

Author Message
epidos

Posts: 20
Posted: 12/23/2006, 12:02 PM

If I have only 1 table and use the group by then it works but as soon as there is another table then it just keeps giving this error:

Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/ArticleCMS/Classes.asp, line 3308


I even generated the grid with grid builder using the quary builder and it is exactly the same result. :-@
View profile  Send private message
Edd


Posts: 547
Posted: 12/23/2006, 4:24 PM

This means that your SQL is incorrect, you pobably have a field in your select that is not in your group statement.

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
epidos

Posts: 20
Posted: 12/23/2006, 7:09 PM

Quote Edd:
This means that your SQL is incorrect, you pobably have a field in your select that is not in your group statement.

Edd

What do you mean?

This is the SQL:

SELECT *
FROM Articles LEFT JOIN users ON
Articles.ArticleAuthor = users.user_id
GROUP BY Articles.ArticleAuthor

in the Grid, I don't even show anything except "Articles.ArticleAuthor" and it generates error.


View profile  Send private message
peterr


Posts: 5971
Posted: 12/24/2006, 11:36 PM

I think that this SQL is invalid. For example it is not possible to select all fields (*) when using GROUP BY. Try it in MS Access.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Edd


Posts: 547
Posted: 12/25/2006, 3:19 PM

Peter is correct you must state all columns that are to be grouped in the select as well as the group by statement

Example
SELECT column1, column2, ... column_n, aggregate_function (expression)
FROM tables
WHERE predicates
GROUP BY column1, column2, ... column_n;

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.