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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Function in Subreport

Status
Not open for further replies.

rydexdba

Programmer
Jul 23, 2001
7
US
I am working on a subreport that reports out of a table and it has a subreport that includes a count function. All the fields are in the 'details' section of the main report, including the subreport. The subreport has a one-to-many relationship with the main table. My question is the following:

Is there a way to report the count function of the subreport so that it shows once in the details section of the main report, as opposed to showing one row per each record in the subreport? I would like the following:

MainRecord Date_Field SubReportCount

1234567 03-04-03 2
1234568 03-04-03 6

Right now, it is coming up as:

MainRecord Date_Field SubRecordCount

1234567 03-04-03 2
1234567 03-04-03 2
1234568 03-04-03 6
1234568 03-04-03 6
1234568 03-04-03 6
etc,
etc,

Any help would be greatly appreciated. Thank you.
 
This looks more like a main report error than the subreport. Showing too many times in the subreport would look like

1234567 03-04-03 2
2
1234568 03-05-03 6
6
6

Save your report - delete the subreport and run it and see if you get the same results (sans the subreport). If it is still duplicating the problem is in the main report. Close the report without saving to get back your subreport version.

Lisa
 
I got the subreport to display the correct count of all records linked to the main report and to display only once in the details section of the Main report. Now, I would like to get the count of only certain records in the subreport, like so:

count(activity_id) where activity_type = 'meeting'

Currently, I have the formula in the subreport like so:

count(activity_id)

Is there any way to just get the count of the records I am looking for as opposed to all of the records?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top