Add a Sum command to... (1 Viewer)

fletchee2003

Registered User.
Local time
Today, 01:06
Joined
Apr 21, 2005
Messages
31
Is it possible to add a sum comman to a yes/no column? I also changed the column in the table to a number using 0 as no and 1 as yes. When I added =Sum([Attending FISH]) all I got was #Error in the report view. Am I stupid? Well, yeah; but can anyone help me?
 

powerz

New member
Local time
Yesterday, 23:06
Joined
May 19, 2006
Messages
4
Add a hidden field = iif(Attended, 1, 0). Then do sum again.
 
R

Rich

Guest
=Sum(Iif([YourField],1,0))
 

fletchee2003

Registered User.
Local time
Today, 01:06
Joined
Apr 21, 2005
Messages
31
I tried both of those commands and I still got the #Error script. I can eamil the database if anyone wants to look at it. Any more suggestions?
 

fletchee2003

Registered User.
Local time
Today, 01:06
Joined
Apr 21, 2005
Messages
31
I tried that. Here are some screen captures of what I have. On the query, I enter 0 for a No and I have to enter a -1 for a yes. Is that normal?
 

Attachments

  • access_report.doc
    89 KB · Views: 129
R

Rich

Guest
You shouldn't be entering data directly into a query and where on the Report is the calculated control?
 

fletchee2003

Registered User.
Local time
Today, 01:06
Joined
Apr 21, 2005
Messages
31
I added a query to find out who has and has not attended FISH. I would to know the number of those who plan on attending FISH. I added to the screen capture; I hope that is what you were asking.
 

Attachments

  • access_report.zip
    79.7 KB · Views: 118
S

stampkelly

Guest
on a report - how to get a total from a yes/no field.

Rich said:
Change the field back to a Yes/No boolean field in the Table

I am having the same problem. I have tried the IF expression as indicated and am still very unsuccessful.
Tried:
=Sum(If([MyField],1,0))
added txtBox with:
=If([MyField]),1,0)
However, the txtBox with:
=Count([ID_MyField])
{which is the primary key field also} -yields success - a total number of entries into that table that IS correct.
The breakdown of the total number of 'yes' entries is still elusive.
Any help will be appreciated.
 

Users who are viewing this thread

Top Bottom