CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Get Record Count

Print topic Send  topic

Author Message
JayEdgar


Posts: 77
Posted: 11/16/2006, 7:26 PM

I have a report that is based on a pig of a query. I do NOT want to show the report if there are over, say, 100 records returned by the criteria entered in the search form. I've been searching and searching, and all of the options that I should be able to find in code (using PHP) to get the record count aren't available.

I want to do something like in BeforeShow if RecordCount > 100 report->visible = no and warn user to enter better criteria.

Can someone help me out?

Many thanks,

Jay
View profile  Send private message
Oper


Posts: 1195
Posted: 11/16/2006, 8:06 PM

use ccdlookup("count(*)","Table","Criteria Here",ConenctionHere)

Criteria will be the Criteria used for your report

Check help
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
JayEdgar


Posts: 77
Posted: 11/17/2006, 4:41 AM

CCDLookup isn't any help to me - as I mentioned, this is a pig of a query - lots of tables within CodeCharge.

I checked help extensively and can't find the command.

Thanks. Anyone else?

Jay
View profile  Send private message
peterr


Posts: 5971
Posted: 11/17/2006, 10:09 AM

Jay,

Please check your database documentation (or support or forums) to find out how to obtain the record count of the last run query. I'm not aware of such feature in any database but never investigated this either, while it seems that this is what you are expecting or implying that this is possible.
If your database doesn't support this then obviously there is no other way but to re-run the query with the COUNT clause, for example using ccdlookup (CCS Help has examples).

NOTE: this question is not directly related to CCS (in the context you gave it) and you may get more feedback in database forums
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Oper


Posts: 1195
Posted: 11/24/2006, 10:16 PM

Quote JayEdgar:
CCDLookup isn't any help to me - as I mentioned, this is a pig of a query - lots of tables within CodeCharge.

I checked help extensively and can't find the command.

Thanks. Anyone else?

Jay

Again CCdlookup is the way, you are using codecharge, when the user enter there criteria on a query that have 1255 Table linked the Grid on codecharge will give you the criteria used for use in the ccdlookup no matter what criteria user did or no matther how many table you used

Datasource.where or datasource.sql

and the use ccdlookup.


Also you still could use the old simple trick after Page was generated you coudl check how many record was obtained before display grid and redirect to a page telling him criteria search record is to high, etc. (still i like the frst)

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
JayEdgar


Posts: 77
Posted: 11/27/2006, 8:46 AM

You can do a CCD lookup with more than one table in the 'from' portion of the search? didn't know that.

That 'simple old trick' you referred to about getting the number of records is EXACTLY what I wanted to know - please let me know what that is.

Thanks,

Jay
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.