Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i count the number of records

Status
Not open for further replies.

wainot

Programmer
Mar 2, 2005
8
US
Hello,

This is a really simple question that has been bugging me. I'm new to Crystal Reports XI. I do a select portNumber from reports. This returns all the portNumbers that are in the database. I only want to display the portNumbers once and have a total on that portNumber. Can someone please help me. Thank you in advance.
 
I assume that you mean you want to show the distinct port number and the counts of each?

You can either use a cross-tab (Insert->Crosstab on the main menu) and place the Portnumbers as the row, and a count of the portnumber as the summary field, or you can just group the report by the port number, palce the portnumber field in the details, right click it and select insert->summary->Count and select for the group.

Then suppress the group header and the details sections and display the port number in the group footer alongside the count you just created.

-k
 
Thank you for the quick reply, but that wasn't exactly what I was looking for. I should have been more clear on what I wanted.

Here is an example of what I want to see

portNumber Total
1234 15
2345 20

I want to know how to get the total in the details field.
Thanks for showing me about the crosstab, I didn't know about that one.
 
Either one of SynapseVampire's suggestions will do exactly what you appear to want done. Did you try them? The crosstab would be placed either in the report header or report footer, if you go that route.

-LB
 
I have tried both ways that SynapseVampire suggested, but they are for the header or footer. The total is in the details section. I'm trying to get the Total number in my previous example.
 
Why does it need to be in the Details??? You say that you only want distinct, and then say you want to show it where it isn't distinct.

Anyway, if you only select the port number, and turn on the Database->Select Distinct Records you should get what you want.

-k
 
I got the port number to show up once with distinct records. But how do I get the total to show the number of port numbers in the detail section?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top