Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate a control using yes/no data types

Status
Not open for further replies.

nubianqueen

Technical User
Apr 16, 2002
19
0
0
US
I have a database that tracks the duties completed by cetain users. One of my tables has 10 questions with a yes/no data types.
The questions are a subform and query based. What I have to do is count each yes and each no for all 10 questions on a daily bases, then find a overall total and precentage. The problem is I'm not sure how to count each question, especially if QuestionA is yes for day1 and no for day2. Does this make since? If so i would really appreciate some help.
Thanks
 
Well, we know that in a yes/no field, a YES or TRUE equates to -1 (negative one) and a NO or FALSE equates to 0 (zero).

So if you sum the yes'es and multiply by -1, you'll get a postive 'sum' of them, and if you count up the NOs you'll get a count of them.

You could also COUNT the YES'es, but you probably shouldn't SUM the NO's...

Since all of your questions appear to be separate records, you'll probably need some sort of domain aggragate function (not to be confused with a domain AGGRAVATION function..) to sum/count them up:

Q1Count =
DCount("Question1", ID = {ParentKEY})

Where you are counting (true's only) the question 1 values for a particular person.

IF you have a fixed number of questions, you can also get the NO's by subtracting the YES'es from the fixed count.

Hope this gets you on your way...





There are two ways to argue with a woman - neither one works.
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top