If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Count of Report values in Report Footer
Hi
I need to create a count at the end of my report that tells me how many occurances of a certain value appear in the report. e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to count how many times red and amber occurs. I guess, something like "COUNT(Issue) where Issue = "Red")" is needed. e.g. 2 (more complex) e.g. Report field of "Name". I do not want to "hard code" the possible values that can appear in the report for Name but I need to count how many times each name appears in the report. I have played around with SUM and COUNT and tried the Running Sum function but to no avail. Any help much appreciated. Thanks, Mark |
#2
|
|||
|
|||
Count of Report values in Report Footer
Mark A wrote:
I need to create a count at the end of my report that tells me how many occurances of a certain value appear in the report. e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to count how many times red and amber occurs. I guess, something like "COUNT(Issue) where Issue = "Red")" is needed. e.g. 2 (more complex) e.g. Report field of "Name". I do not want to "hard code" the possible values that can appear in the report for Name but I need to count how many times each name appears in the report. I have played around with SUM and COUNT and tried the Running Sum function but to no avail. For a quick and dirty approach, you can use expressions like this: =Sum(IIf(Issue = "red", 1, 0)) But, you're right, you do not want to use hard coded values most of the time. A more general approach is to create a Totals type query that retrieves the desired data and calculates the counts for each name or issue. Then use the query as the record source for a subreport. -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Count of Report values in Report Footer
Hi Marshall,
Ive tried the =Sum(IIf(Issue = "red", 1, 0)) but it did not seem to work, could you provide an alternate approach or give more details regarding how to create a totals type query. Any help you can provide would be great. Regards. Nick "Marshall Barton" wrote: Mark A wrote: I need to create a count at the end of my report that tells me how many occurances of a certain value appear in the report. e.g. Report field of "Issue". Possible values of "Red" or "Amber". Need to count how many times red and amber occurs. I guess, something like "COUNT(Issue) where Issue = "Red")" is needed. e.g. 2 (more complex) e.g. Report field of "Name". I do not want to "hard code" the possible values that can appear in the report for Name but I need to count how many times each name appears in the report. I have played around with SUM and COUNT and tried the Running Sum function but to no avail. For a quick and dirty approach, you can use expressions like this: =Sum(IIf(Issue = "red", 1, 0)) But, you're right, you do not want to use hard coded values most of the time. A more general approach is to create a Totals type query that retrieves the desired data and calculates the counts for each name or issue. Then use the query as the record source for a subreport. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to keep the report footer on the same page? | homer | Setting Up & Running Reports | 3 | October 21st, 2005 07:27 PM |
Report footer is printing on a separate page | Dana W. Ciardi | General Discussion | 0 | September 12th, 2005 04:48 PM |
To Sharkbyte and all: Calculate a total values in group level | Ally | General Discussion | 6 | June 13th, 2005 08:16 PM |
Need count in footer but no detail in report | mscertified | Setting Up & Running Reports | 1 | February 28th, 2005 09:54 PM |
Repost-Still Suffering with Subreports | IreneJ | Setting Up & Running Reports | 9 | August 31st, 2004 04:55 AM |