General discussion

Locked

EASY Access 97 Count Question

By MRA2 ·
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

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

EASY Access 97 Count Question

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

Collapse -

EASY Access 97 Count Question

by MRA2 In reply to EASY Access 97 Count Ques ...

The question was auto-closed by TechRepublic

Collapse -

EASY Access 97 Count Question

by john_wills In reply to EASY Access 97 Count Ques ...

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

Collapse -

EASY Access 97 Count Question

by MRA2 In reply to EASY Access 97 Count Ques ...

The question was auto-closed by TechRepublic

Collapse -

EASY Access 97 Count Question

by whyong In reply to EASY Access 97 Count Ques ...

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.

Collapse -

EASY Access 97 Count Question

by MRA2 In reply to EASY Access 97 Count Ques ...

The question was auto-closed by TechRepublic

Collapse -

EASY Access 97 Count Question

by TimFox2 In reply to EASY Access 97 Count Ques ...

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

Collapse -

EASY Access 97 Count Question

by MRA2 In reply to EASY Access 97 Count Ques ...

The question was auto-closed by TechRepublic

Collapse -

EASY Access 97 Count Question

by MRA2 In reply to EASY Access 97 Count Ques ...

This question was auto closed due to inactivity

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums