The Dbase is running on SQL Server 7.0.
I have a field that is broken into subset's of data seperated by comma's.
table looks like:
tblAnswers
This is a Data Field that is filled(with Radio Boxes) by users on a web site.
Ans_QuestionnaireID=345 relates to pet's.
Ans_Question=6 ask what types of pets they own.
If the Choices are Cat, Dog, Bird, Other, None
The Data Field will look like :
If they own only a
1.Is there a way to run a query that looks like
2.How can I ask for a list of users that own Dogs
SELECT Ans_UserID FROM tblAnswers WHERE
Ans_QuestionnaireID=345 AND
Ans_Question=6 AND
Ans_String_Val=',on,,,'
BUT this is only good if they own only a dog! I need a complete list of dog owners, whether or not they own other pets.
I asked this in the ANSI_SQL Forum thread220-67351,
but know one was able to help, so I thought someone in here has come accross this before.
Thanks, Michael
Sorry for such a long post, but wanted to completely explain it.
I have a field that is broken into subset's of data seperated by comma's.
table looks like:
tblAnswers
Code:
Ans_QuestionnaireID = Relates to Product
Ans_Question = Relates to Question Number
Ans_String_Val(varChar1024)= Is the answer to the Question
Ans_UserID = User ID
This is a Data Field that is filled(with Radio Boxes) by users on a web site.
Ans_QuestionnaireID=345 relates to pet's.
Ans_Question=6 ask what types of pets they own.
If the Choices are Cat, Dog, Bird, Other, None
The Data Field will look like :
If they own only a
Code:
Cat: Ans_String_Val = 'on,,,,'
Dog: Ans_String_Val = ',on,,,'
Bird: Ans_String_Val = ',,on,,'
Other: Ans_String_Val = ',,,on,'
None: Ans_String_Val = ',,,,on'
If they own a Cat and a Dog
Cat & Dog: Ans_String_Val = 'on,on,,,' Ect., Ect.
1.Is there a way to run a query that looks like
Code:
Ans_UserID CAT DOG BIRD OTHER NONE
1 YES YES NO NO NO
2 NO NO NO NO YES
3 NO YES NO YES NO
2.How can I ask for a list of users that own Dogs
SELECT Ans_UserID FROM tblAnswers WHERE
Ans_QuestionnaireID=345 AND
Ans_Question=6 AND
Ans_String_Val=',on,,,'
BUT this is only good if they own only a dog! I need a complete list of dog owners, whether or not they own other pets.
I asked this in the ANSI_SQL Forum thread220-67351,
but know one was able to help, so I thought someone in here has come accross this before.
Thanks, Michael
Sorry for such a long post, but wanted to completely explain it.