Trouble adding specific set of records.

diazr

Registered User.
Local time
Today, 12:03
Joined
Jul 31, 2008
Messages
24
I have a report that in one column I have a mix of YES's and NO's and I'm trying to add only the yes's and get a total. From research DCount is my best choice I believe to make this work. The report is pulling its data from query "Weekly Report Filter" and the field that is storing the YES's and NO's is [FORM104]. So far this is the code but its giving me a total of "1" even if there is no YES in the list... Any help would be appreciated.


=DCount("[FORM104]","Weekly Report Filter","[FORM104] = 'YES' ")
 
if text field then try this

Code:
=DCount("[FORM104]","Weekly Report Filter","[FORM104]'" &  = 'YES' )

if it is a yes/no field then this one should work

Code:
=DCount("[FORM104]","Weekly Report Filter","[FORM104]=" & -1)
 
Hi Khawar!

Currently I have it as a text field for I imported the data, but evnetually it will be a yes/no field.. I tried the code you send me for the text field and im getting a invalid syntax error.. Looks like the single quotes you have near the & is causing it but no dice cant get it to work.
 
Thank you everyone for your help eventhough the codes suggested was not the output I was looking for. For future members who have a similiar question below is the correct code:

=Sum(IIf([FORM104]="YES",1,0))
 

Users who are viewing this thread

Back
Top Bottom