PC Review


Reply
Thread Tools Rate Thread

Best table or solution for my database

 
 
GabrielG
Guest
Posts: n/a
 
      25th May 2004


Hello everyone ,
I have a little problem and I need some advice to setup a database. I
created a table with approximately 20 columns. The columns have an entry of
Yes or no based on a questionnaire from survey. My question is what can I do
to get a result of my table I would like to know how many "Yes" and "no" I
have. I don't know how to add them or get this information.

Note I would like to add them by columns not by row.
Thanks in advance


 
Reply With Quote
 
 
 
 
Brian Kastel
Guest
Posts: n/a
 
      25th May 2004
One suggestion: create a select query that uses aggregate functions:

SELECT Sum(Abs([Resp1])) AS SumOfResp1, Sum(Abs([Resp2])) AS SumOfResp2, ...
FROM tblSurvey;

Since Yes is -1, totaling the absolute values of the field will provide your
answer.

Counting the Yes values explicitly should work, too, but for some reason
when I tried that using criteria my query invariably returned the total
number of records.


"GabrielG" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
>
> Hello everyone ,
> I have a little problem and I need some advice to setup a database. I
> created a table with approximately 20 columns. The columns have an entry

of
> Yes or no based on a questionnaire from survey. My question is what can I

do
> to get a result of my table I would like to know how many "Yes" and "no" I
> have. I don't know how to add them or get this information.
>
> Note I would like to add them by columns not by row.
> Thanks in advance
>
>
>



 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      25th May 2004
"GabrielG" <(E-Mail Removed)> wrote in
news:#(E-Mail Removed):

> created a table with approximately 20 columns. The columns have an
> entry of Yes or no based on a questionnaire from survey. My question
> is what can I do to get a result of my table I would like to know how
> many "Yes" and "no" I have. I don't know how to add them or get this
> information.


That is largely because the db design is wrong. The twenty yes/no columns
should be twenty rows in an Answers table like this (* means primary key,
as usual):-

Answers
=======
*QuestionnaireID references the main Questionnaires table
*QuestionNumber references the Questions table, if you have one
Value true/false, reports the actual answer given.

so it looks like this:

QuestionnaireID QNumber Value
=============== ======= -----
Eric 1 Yes
Eric 2 No
Samantha 1 Yes
Samantha 2 Yes


It then becomes easy to count how many questions were answered, how many
yesses, how many said (Yes, No) and so on. As you have discovered,
designing big wide tables like spreadsheets does not solve many problems.

B Wishes


Tim F

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not Updating the physical database table (Access Database table) =?Utf-8?B?UGV0ZXI=?= Microsoft Dot NET Framework Forms 0 11th Jul 2007 03:46 PM
Any solution for error message "Could not attach file 'App_Data\Database.mdf' as database 'Database'."? ornit_sagy@yahoo.com Microsoft ADO .NET 0 8th Jan 2007 09:34 PM
Any solution for error message "Could not attach file'App_Data\Database.mdf' as database 'Database'."? ornit_sagy@yahoo.com Microsoft ADO .NET 1 8th Jan 2007 09:12 PM
Web Solution to database =?Utf-8?B?TWFyaWU=?= Microsoft Access 2 31st Jan 2006 08:15 PM
Best table or solution for my database GabrielG Microsoft Access Database Table Design 2 25th May 2004 06:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:10 AM.