Discussion Locked

EASY Access 97 Count Question

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a table with 2 fields. Name (Text) and Present (Yes/No Checkbox). There are 6 records, three are checked.

I made a report with both fields and was able to get a count of all names (6).
Now I want to count only the check boxes. I made a calculated field called checked and put =(IFF([Present] = "-1" , 1, 0))
I put this field in the detail section.

NOW, in the report Footer, I want to Count all the "checked" records. I keep getting a Parameter box for the checked field.

What am I doing wrong???

Thanks,
Alan

9 replies

by seagull data services

Try typing the following in sql view for your query:

Select Table1.present, Count(Table1.Name) as CountofName
From Table1
Group By Table1.Present
Order By Table1.Present;

Replace "Table1" with the name of your table then run the query.
If you want to see how it's done in the design grid, look at the design grid and note that the Sigma button on the query design toolbar is checked
Hope this helps
John

by john_wills

I don't know what you're doing wrong, but I suspect you're using count where you should be using sum or total.

by whyong

try to do the "count" in the details section (assign to text1 and invisible if necessary), and create a text box (text2) in the report footer, set the text2's control source = text1.value.

by timfox2

The count field in your report footer will have to use the name of the text box (or whatever control that you've used) that appears on your report - not the name of the field in the table.

So, the value in your footer will read something like: =(Count([checked]), which will count the number of checked values that appear in your report.

I'm not sure why you are putting the formula into the calculated field - why not just let Access display the actual value? In this instance, you might be better off using the sum formaula that has already been mentioned: = (Sum([checked]))

Hope this helps
Tim

This discussion is closed to new replies.