BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Number of 1's in a field.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Steve Warburton
Guest





PostPosted: Mon May 24, 2004 4:10 pm    Post subject: Number of 1's in a field. Reply with quote



I need to achieve the following and wonder if any of you have any ideas on
the best approach.

We will recieve market research data that will be in the format.
Question 1.(relavent question eg are you happy with our service?)

Answers
1. always 2.never 3.sometimes 4.dontknow etc etc upto 6 fields.

Question2. etc etc upto Question 15.

The answer can only be a tick in a one box for each question.

This information will be emailed to the client in the format.
DataCollector_ID.
Date.
Time.
Question1.(3)
Question2.(2) etc where the number is the box that was ticked.


This would build up a table containing all the answers to all the questions.

How do I search through the data to find out how many of question1 were
answered 1 then 2 then 3 and the same with question2 etc.

Once I have these should I create another table and post the results into
the new table.

I could then show in reports what the totals of each question's answers
were.


Many thanks in advance.

SteveW


Back to top
Uncle Potato
Guest





PostPosted: Tue May 25, 2004 7:05 am    Post subject: Re: Number of 1's in a field. Reply with quote



On Mon, 24 May 2004 17:10:33 +0100, "Steve Warburton" <SteveNospam>
wrote:

Quote:
We will recieve market research data that will be in the format.
Question 1.(relavent question eg are you happy with our service?)

Answers
1. always 2.never 3.sometimes 4.dontknow etc etc upto 6 fields.

This would build up a table containing all the answers to all the questions.

You may build your table as

ID Q1 Q2 Q3 .. Q15
001 1 2 1
002 2 1 3

or

ID Q A
001 1 1
001 2 2
001 3 1
002 1 2
002 2 1
002 3 3

Quote:
How do I search through the data to find out how many of question1 were
answered 1 then 2 then 3 and the same with question2 etc.

Then you can use a simple SQL statement to find out the count for
Question 1 having ans=1

SELECT Count(*) from Table1 where Q1=1
or
SELECT count(*) from Table2 where q=1 and A=1




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.