yes/no total

  • Thread starter Thread starter tina
  • Start date Start date
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
 
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 <--
 
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 <--
 
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 <--
 
Back
Top