A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count IIF



 
 
Thread Tools Display Modes
  #1  
Old September 2nd, 2009, 10:05 PM posted to microsoft.public.access.reports
tlynnlow
external usenet poster
 
Posts: 1
Default Count IIF

I have a field that has two possible answer choices for example: "red apples"
or "green apples". In my report, I would like to count how many people
picked "red apples". I cannot get this to work. Any suggestions?
  #2  
Old September 2nd, 2009, 10:29 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Count IIF

On Wed, 2 Sep 2009 14:05:01 -0700, tlynnlow wrote:

I have a field that has two possible answer choices for example: "red apples"
or "green apples". In my report, I would like to count how many people
picked "red apples". I cannot get this to work. Any suggestions?


And the datatype of this field is what? Text? Number? Boolean?
Assuming, from your example, that it is Text datatype, then. using an
unbound control, set it's control source to:
=Sum(IIf([FieldName] = "red apples",1,0)
Use another control:
=Sum(IIf([FieldName] = "green apples",1,0)
You can place the control anywhere in the report except the Page
Header or Page Footer.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.