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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stumped on Query to pull out questionaire

Status
Not open for further replies.

befine

Instructor
Apr 18, 2002
79
US
I not sure if this has been asked before. If so, could someone send me the thread number?
Now that I have my Access database working, they want some additions.

Basically, I have 50 customers, each one has a questionnaire with 21 questions. I need to pull out the questionnaires (all 21 q) for just the customers that have answered. Any customer who has answered ANY question has an answer in Q1. I’ve tried some different queries and they have me stumped on this.

I’d appreciate any help or leads to follow.
Thanks
 
What are the structures of you customer and questionaire tables?



Mike Pastore

Hats off to (Roy) Harper
 
Thanks for a quick response.

The Cust tbl is keyed on CustID.
The Questionaire table is also keyed on CustID with
fields for QNumber, Answer. With a one-to-many relationship Cust tbl to Question tbl.

I'm trying to keep the whole as basic as possible. This will be turned over to someone with very basic knowledge of db's.

If you need more info, let me know.

Thanks
 
Ok, if you want to know anyone who at least answered q1...

select * from Questionaire where custID in(
select custID from Questionaire where qnumber=1
and answer is not null)

Mike Pastore

Hats off to (Roy) Harper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top