Counting Records in a Report or Query

G

Guest

I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David
 
A

Al Camp

David,
Let's say you have a field on your report called DuesPaid.
In the Report Footer, and unbound calculated text control with a Control Source of...
= Sum(DuesPaid)
would give you the total of all DuesPaid over the whole report.

That same calculation, in a Group Footer, would yield the sum for that Group.

Never name a calculated control the name of any of the fields within that calculation.
In this example, TotalDuesPaid would be a good name...
DuesPaid must not be a "calculated on the report" field. It must be a "bound" field.
 
G

Guest

I am very new to all this so please bear with me. If I don't calculate this
on the report - where do I calculate it? Table, query or report?

Thanks

David
 
F

fredg

I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]
 
A

Al Camp

David,
Example... Price * Qty = LineTotal
In your query design grid, add a calculated column like this
LineTotal : [Price] * [Qty]
Now, the calculation is a "bound" to LineTotal. Place LineTotal on your report, and
you can Sum on that field in any Group, or ReportFooter.
 
G

Guest

fredq,
I tried that but it wont show the count. That is as important as the count
itself. Visable=Yes but that still does not work.

fredg said:
I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]
 
F

fredg

fredq,
I tried that but it wont show the count. That is as important as the count
itself. Visable=Yes but that still does not work.

fredg said:
I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]

You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
 
G

Guest

All I want is a count of the total records. I have tried to put an unbound
Count([Reccomenadations]) on the report and it does not show any problems -
it just wont display the answer.

I'll go ahead and give the idea below a try.

Thanks for the help.

Al Camp said:
David,
Example... Price * Qty = LineTotal
In your query design grid, add a calculated column like this
LineTotal : [Price] * [Qty]
Now, the calculation is a "bound" to LineTotal. Place LineTotal on your report, and
you can Sum on that field in any Group, or ReportFooter.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
I am very new to all this so please bear with me. If I don't calculate this
on the report - where do I calculate it? Table, query or report?

Thanks

David
 
G

Guest

I tried it in the Page Footer. Yes both Visible properties are set to "Yes".
I'm pretty sure there is no Cancel=True statement.
I don't get any count at all.
"=Count([Recommenadations])". Recommenadation (yes that's how I spelled it)
is a column of recommendations.
You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
fredg said:
fredq,
I tried that but it wont show the count. That is as important as the count
itself. Visable=Yes but that still does not work.

fredg said:
On Mon, 3 Apr 2006 05:10:02 -0700, DDrowe wrote:

I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]

You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
 
A

Al Camp

DDrowe,
That's your problem... calculated Count/Sum/Avg etc... fields work in ReportFooters and
GroupFooters, not Page Footers.
If you need to Count in the Page Footer, see Microsoft KnowledgeBase article Q132017.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;132017
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
I tried it in the Page Footer. Yes both Visible properties are set to "Yes".
I'm pretty sure there is no Cancel=True statement.
I don't get any count at all.
"=Count([Recommenadations])". Recommenadation (yes that's how I spelled it)
is a column of recommendations.
You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
fredg said:
fredq,
I tried that but it wont show the count. That is as important as the count
itself. Visable=Yes but that still does not work.

:

On Mon, 3 Apr 2006 05:10:02 -0700, DDrowe wrote:

I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]

You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
 
G

Guest

That did it. Thanks. THat's exactly what I was looking for.

Al Camp said:
DDrowe,
That's your problem... calculated Count/Sum/Avg etc... fields work in ReportFooters and
GroupFooters, not Page Footers.
If you need to Count in the Page Footer, see Microsoft KnowledgeBase article Q132017.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;132017
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
I tried it in the Page Footer. Yes both Visible properties are set to "Yes".
I'm pretty sure there is no Cancel=True statement.
I don't get any count at all.
"=Count([Recommenadations])". Recommenadation (yes that's how I spelled it)
is a column of recommendations.
You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
fredg said:
On Mon, 3 Apr 2006 10:09:02 -0700, DDrowe wrote:

fredq,
I tried that but it wont show the count. That is as important as the count
itself. Visable=Yes but that still does not work.

:

On Mon, 3 Apr 2006 05:10:02 -0700, DDrowe wrote:

I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
 
A

Al Camp

David,
Although I had mentioned in my first post about ReportFooter and GroupFooter... it was
FredG that hit upon the correct "question" to ask you!
Once you answered his question... the fix was a "gimme."
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
That did it. Thanks. THat's exactly what I was looking for.

Al Camp said:
DDrowe,
That's your problem... calculated Count/Sum/Avg etc... fields work in ReportFooters
and
GroupFooters, not Page Footers.
If you need to Count in the Page Footer, see Microsoft KnowledgeBase article
Q132017.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;132017
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
I tried it in the Page Footer. Yes both Visible properties are set to "Yes".
I'm pretty sure there is no Cancel=True statement.
I don't get any count at all.
"=Count([Recommenadations])". Recommenadation (yes that's how I spelled it)
is a column of recommendations.

You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
:

On Mon, 3 Apr 2006 10:09:02 -0700, DDrowe wrote:

fredq,
I tried that but it wont show the count. That is as important as the count
itself. Visable=Yes but that still does not work.

:

On Mon, 3 Apr 2006 05:10:02 -0700, DDrowe wrote:

I want a block at the bottom of my report that give the total number of
records in that report. I found a "Count" function in the help section but I
can not get it to work or display.

Any help is greatly appreciated.

David

You want the count of the number of records in the report?
Add an unbound control to the REPORT Footer.
=Count(*)

To display the count in the PAGE Footer, add another unbound control.
Set it's Control Source to:
=[NameOfControlInReportFooter]
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


You tried 'it' where? In the Page Footer? In the Report Footer?
Was the visible property of these controls set to Yes? Was the Visible
property of the section the control is in set to Yes? Do you have any
code 'Cancel = True' in the section the control is placed?
Do you get the correct count and display in the Report Footer?
What are the names of these controls?
What are the EXACT expressions you are using?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top