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 -> General/Other

 Mistake on $this->CountSQL for a grid

Print topic Send  topic

Author Message
Manuel
Posted: 06/02/2005, 7:46 PM

Having a GROUP BY query: SELECT t1.f1, SUM(t2.f2) FROM t1 LEFT JOIN t2 ON t1.f1 = t2.f2 WHERE t1.f1 = '{Expr0}' GROUP BY t1.f1

... as DataSource of a grid, generates a mistake on the grid.

This is because the resulting query: SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.f1 = t2.f2... returns no only one row.

How can it be fixed???
Manuel
Posted: 06/02/2005, 7:49 PM

Well, the query indeed is:

SELECT t1.f1, SUM(t2.f2) FROM t1 LEFT JOIN t2 ON t1.f1 = t2.f2 WHERE t1.f3 = '{Expr0}' GROUP BY t1.f1 The field on the where is not the same that field on the GROUP BY.
Nicole

Posts: 586
Posted: 06/03/2005, 4:42 AM

Manuel,
countSQL returns "1" because of GROUP BY clause. You need to modify countSQL generated by CCS and exclude GROUP BY. You can modify countSQL in Before Execute Select event as described in Help
http://docs.codecharge.com/studio/html/ProgrammingTechn...ifySQL.html?toc


_________________
Regards,
Nicole
View profile  Send private message
Manuel
Posted: 06/03/2005, 7:06 AM

Thanks a lot Nicole.

Regards

Manuel.

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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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