Using the count function with a condition in an Access Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have an access report pulling information from a query. One of the fields
is “PHD†and it has values “yesâ€, “No†& “N/Aâ€. I understand that I can use
“=count ([PHD])†in a text box to count the total number of people with PHDs
but is it possible for me to only count the number of people with PHDs (“Yesâ€
value)?

Please help!!!!!!!!!!!!!
KASH
 
Hi,

I have an access report pulling information from a query. One of the fields
is ´PHD¡ and it has values ´yes¡, ´No¡ & ´N/A¡. I understand that I can use
´=count ([PHD])¡ in a text box to count the total number of people with PHDs
but is it possible for me to only count the number of people with PHDs (´Yes¡
value)?

Please help!!!!!!!!!!!!!
KASH

How about an unbound control with a controls source of:

=Sum(IIf([PHD] = "Yes",1,0))
 
Thanks a lot!
This works perfectly!

fredg said:
Hi,

I have an access report pulling information from a query. One of the fields
is “PHD†and it has values “yesâ€, “No†& “N/Aâ€. I understand that I can use
“=count ([PHD])†in a text box to count the total number of people with PHDs
but is it possible for me to only count the number of people with PHDs (“Yesâ€
value)?

Please help!!!!!!!!!!!!!
KASH

How about an unbound control with a controls source of:

=Sum(IIf([PHD] = "Yes",1,0))
 
Hi
I am trying to do the same thing but my field name is "line No_" and the
value I want to count is 10000. I tried =Sum(IIf([line No_] = "10000",1,0)).
but keep getting errors. I am on the right track?

Thanks
SL

fredg said:
Hi,

I have an access report pulling information from a query. One of the fields
is “PHD†and it has values “yesâ€, “No†& “N/Aâ€. I understand that I can use
“=count ([PHD])†in a text box to count the total number of people with PHDs
but is it possible for me to only count the number of people with PHDs (“Yesâ€
value)?

Please help!!!!!!!!!!!!!
KASH

How about an unbound control with a controls source of:

=Sum(IIf([PHD] = "Yes",1,0))
 
Assuming it's a numeric field, get rid of the quotes around 10000

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



SL said:
Hi
I am trying to do the same thing but my field name is "line No_" and the
value I want to count is 10000. I tried =Sum(IIf([line No_] =
"10000",1,0)).
but keep getting errors. I am on the right track?

Thanks
SL

fredg said:
Hi,

I have an access report pulling information from a query. One of the
fields
is "PHD" and it has values "yes", "No" & "N/A". I understand that I
can use
"=count ([PHD])" in a text box to count the total number of people with
PHDs
but is it possible for me to only count the number of people with PHDs
("Yes"
value)?

Please help!!!!!!!!!!!!!
KASH

How about an unbound control with a controls source of:

=Sum(IIf([PHD] = "Yes",1,0))
 
OMG !!! this is just wonderful !! thank you soooo much...been brain frying
over this type of thing all morning and you posted the answer !! thank you
thank you thank you !!!!
--
terri


fredg said:
Hi,

I have an access report pulling information from a query. One of the fields
is “PHD†and it has values “yesâ€, “No†& “N/Aâ€. I understand that I can use
“=count ([PHD])†in a text box to count the total number of people with PHDs
but is it possible for me to only count the number of people with PHDs (“Yesâ€
value)?

Please help!!!!!!!!!!!!!
KASH

How about an unbound control with a controls source of:

=Sum(IIf([PHD] = "Yes",1,0))
 
THANK YOU!!!!! - this forum is fantastic as most of the things that I'm
wrestling with are already answered. This is just one of them.
Fee08
 
kash said:
i really need help to find out the easiest formula to be used to find out
the total value in the report design view. if u really don't mind, i can
upload the documents and you can help me.

Conrad
thanks
 
Back
Top