Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to count records ? Post Reply Post New Topic
Author Message
abidshahzad4u
Newbie
Newbie
Avatar

Joined: 11 Jan 2010
Location: Pakistan
Online Status: Offline
Posts: 2
Quote abidshahzad4u Replybullet Topic: How to count records ?
    Posted: 11 Jan 2010 at 10:22pm
Hi
 
I am new to Crystal Reports and I have a problem.
 
I extract the data from a table which have more than 300 records. Now I want to generate the summary of them means that how many records are there which are from Category A, Category B and C. Categories are also more than 50.
 
I have tried count() with different parameters, but it was not useful.
 
My job can be describe in SQL as
select count(id) from tableA where category = "a"
 
I want to use such login on the data present in the report.
 
with regards
Abid Shahzad
Web Developer & SEO
IP IP Logged
majki
Newbie
Newbie
Avatar

Joined: 22 Dec 2009
Location: Poland
Online Status: Offline
Posts: 13
Quote majki Replybullet Posted: 12 Jan 2010 at 5:16am
Hm, I'm not sure what you want to get.. Does SQL 'group by' works for you?
Like this:
select category, count(*) as whatever from table group by category

I would do this only when I need summary (or as sub-report in summary section), otherwise below should be fine for you:

In Crystal reports on 'Insert' toolbar, you have 'Insert summary' button (or from menu Insert->Summary). It allows you to use for example count by some kind of field. Play with this and let us know.

Would be great if you could post small example (Sample of data and what you want to get).


Edited by majki - 12 Jan 2010 at 6:52am
IP IP Logged
abidshahzad4u
Newbie
Newbie
Avatar

Joined: 11 Jan 2010
Location: Pakistan
Online Status: Offline
Posts: 2
Quote abidshahzad4u Replybullet Posted: 12 Jan 2010 at 10:20pm
Thanks for your reply.
 
my problem is as:
I have created a report having different products and their sales.
I need to put the summary in report footer on the basis of the prodct category. There are more than 500 records and belons to more than 10 categories.
 
I need to count the products which belongs to the category "A", which are already present in the report.
 
How can I do this?
Abid Shahzad
Web Developer & SEO
IP IP Logged
majki
Newbie
Newbie
Avatar

Joined: 22 Dec 2009
Location: Poland
Online Status: Offline
Posts: 13
Quote majki Replybullet Posted: 13 Jan 2010 at 12:34am
I believe, that you also display this category on your report. Use 'Summary' functionality as I wrote.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.015 seconds.