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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query- Totaling yes answer an the calcuating the percent of the to



 
 
Thread Tools Display Modes
  #1  
Old February 4th, 2009, 05:44 PM posted to microsoft.public.access.gettingstarted
EMall
external usenet poster
 
Posts: 2
Default Query- Totaling yes answer an the calcuating the percent of the to

I am trying to created a query that totals the number of "yes" answers in a
data base and then calculates the percent of "yes" versus the total of the
"yes" and "no”. My questions in the DB have n/a and TDB as well for choices,
so I need to exclude these in the roll up of question.
  #2  
Old February 4th, 2009, 07:00 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query- Totaling yes answer an the calcuating the percent of the to

On Wed, 4 Feb 2009 09:44:03 -0800, EMall
wrote:

I am trying to created a query that totals the number of "yes" answers in a
data base and then calculates the percent of "yes" versus the total of the
"yes" and "no. My questions in the DB have n/a and TDB as well for choices,
so I need to exclude these in the roll up of question.


If the datatype of the field is Text and you want to just consider the literal
text strings "Yes" and "No", try

=Sum(IIF([answer] = "yes", 1, 0) / Sum(Iif([answer] = "yes" OR [Answer] =
"no", 1, 0)

You may need some criteria to eliminate cases where there are no answers
containing either yes OR no - you'll get a divide-by-zero error.
--

John W. Vinson [MVP]
  #3  
Old February 4th, 2009, 07:10 PM posted to microsoft.public.access.gettingstarted
Golfinray
external usenet poster
 
Posts: 1,597
Default Query- Totaling yes answer an the calcuating the percent of the to

In the query criteria us Not Like n/a AND not like TBD

"EMall" wrote:

I am trying to created a query that totals the number of "yes" answers in a
data base and then calculates the percent of "yes" versus the total of the
"yes" and "no”. My questions in the DB have n/a and TDB as well for choices,
so I need to exclude these in the roll up of question.

 




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 01:06 AM.


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