counting records

G

Guest

I have a report that I need to have a count of the number of records. I also
have 1 column that I need to have an average. My report format looks
something like this:
***
Field1 Field2 Field3 Field4 Field5
x x 14
x 3
x 5

Total Number Field1: ___
Total Number Field2: ___
Avg Number Field4: ___
***
I tried =count([Field1]), but I get an error message.

Thanks in advance.
Donna
 
D

Duane Hookom

Did you place the Count() text box in the Page Footer? If so, it won't work.
You could use a group or report footer.

I assume you understand that =Count([Field1]) will count all non-null Field1
values.
 
G

Guest

I have the text boxes in the page footer. Please forgive me for my blonde
moment, but if I'm wanting to count the number of x's in the column titled
field1 can you write out the code that I need to use? I'm entering this code
in the control source block in the properties for this field, correct?

Duane Hookom said:
Did you place the Count() text box in the Page Footer? If so, it won't work.
You could use a group or report footer.

I assume you understand that =Count([Field1]) will count all non-null Field1
values.

--
Duane Hookom
MS Access MVP
--

Dcbrown428 said:
I have a report that I need to have a count of the number of records. I
also
have 1 column that I need to have an average. My report format looks
something like this:
***
Field1 Field2 Field3 Field4 Field5
x x 14
x 3
x 5

Total Number Field1: ___
Total Number Field2: ___
Avg Number Field4: ___
***
I tried =count([Field1]), but I get an error message.

Thanks in advance.
Donna
 
D

Duane Hookom

First move your text boxes to a different footer section.

What type of field is [Field1]? Is it a yes/no? Is it a text field with two
possible values "X" and Null?

If it is a text field and you want to count the number of times the field
contains the value "X", try:

=Abs(Sum([Field1]="x"))

--
Duane Hookom
MS Access MVP


Dcbrown428 said:
I have the text boxes in the page footer. Please forgive me for my blonde
moment, but if I'm wanting to count the number of x's in the column titled
field1 can you write out the code that I need to use? I'm entering this
code
in the control source block in the properties for this field, correct?

Duane Hookom said:
Did you place the Count() text box in the Page Footer? If so, it won't
work.
You could use a group or report footer.

I assume you understand that =Count([Field1]) will count all non-null
Field1
values.

--
Duane Hookom
MS Access MVP
--

Dcbrown428 said:
I have a report that I need to have a count of the number of records. I
also
have 1 column that I need to have an average. My report format looks
something like this:
***
Field1 Field2 Field3 Field4 Field5
x x 14
x 3
x 5

Total Number Field1: ___
Total Number Field2: ___
Avg Number Field4: ___
***
I tried =count([Field1]), but I get an error message.

Thanks in advance.
Donna
 

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