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 -> Tips & Solutions

 Getting Count when using SQL for grid

Print topic Send  topic

Author Message
laneoc

Posts: 147
Posted: 05/24/2011, 12:00 PM

When you use an SQL statement, you may get "...not counted" instead of the count of the grid's rows. Here's a quick and dirty way to get the count you need.

Add code such as the following in a BeforeExecuteSelect Event.

    $oldSQL=$MyGridName->DataSource->SQL;  
    $myCountSQL="select count(*) from (".$oldSQL.") as CountTable";  
    $MyGridName->DataSource->CountSQL=$myCountSQL;  

Change the "MyGridName" to the name of your grid. That's it.


Lane
_________________
Lane
View profile  Send private message
gcastillo

Posts: 45
Posted: 05/26/2011, 3:43 AM

Great Lane !

Thanks for taking the time to share this. I needed this a while ago. :-)
_________________
Giovanni
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.

MS Access to Web

Convert MS Access to Web.
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.