yes/no total

T

tina

Hi
I have a report based on query which has field Analysis from table data type
Yes/No and would like total for yes selection
I tried following in control source of textbox

=IIf([Analysis]="Yes",Sum([SumOfQuantity]),0)
but get result 0
so thouht value of yes maybe 1 so tried
=IIf([Analysis]=1,Sum([SumOfQuantity]),0)
same result
What is value of yes ?
Thanks
Tina
 
S

Stefan Hoffmann

hi Tina,
=IIf([Analysis]="Yes",Sum([SumOfQuantity]),0)
but get result 0
so thouht value of yes maybe 1 so tried
=IIf([Analysis]=1,Sum([SumOfQuantity]),0)
same result
What is value of yes ?
It is a boolean value, so you don't need an equation in this case:

=IIf([Analysis], Sum([SumOfQuantity]), 0)


mfG
--> stefan <--
 
T

tina

Hi Stefan
Thank you for response but this totals where analysis is yes and where is no
I only want where yes
Tina

Stefan Hoffmann said:
hi Tina,
=IIf([Analysis]="Yes",Sum([SumOfQuantity]),0)
but get result 0
so thouht value of yes maybe 1 so tried
=IIf([Analysis]=1,Sum([SumOfQuantity]),0)
same result
What is value of yes ?
It is a boolean value, so you don't need an equation in this case:

=IIf([Analysis], Sum([SumOfQuantity]), 0)


mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Tina,
Hi Stefan
Thank you for response but this totals where analysis is yes and where is no
I only want where yes
Have you tested it?

btw, there is still an error, it must be:


=Sum(IIf([Analysis], [SumOfQuantity], 0))


mfG
--> stefan <--
 

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