scorniglia
Technical User
Hi All,
I'm having a rather perplexing problem and I hope someone can point me in the direction of a solution. I have a table that stores GroupID's and Activity Numbers. Each GroupID can have multiple Activity Numbers such as:
GroupID ActivityNumber
1 2
1 6
1 7
2 6
2 8
3 2
3 6
3 9
The user submits a list of Activities from checkboxes on a form. I want to be able to find only the GroupID's that contain all of the Activities in the list rather than any of them. So if the list passed from the checkbox form is (2,6,7) I want the query to return only GroupID 1. The IN query returns GroupID 1,2 and 3. If the list is (2,8,9) then there should not be any GroupID's returned. I have been having a lot of trouble with this and just can't get it to work correctly. If anybody has any suggestions or thoughts on how would be best to accomplish this I would greatly appreciate it.
Regards,
Roy F.
I'm having a rather perplexing problem and I hope someone can point me in the direction of a solution. I have a table that stores GroupID's and Activity Numbers. Each GroupID can have multiple Activity Numbers such as:
GroupID ActivityNumber
1 2
1 6
1 7
2 6
2 8
3 2
3 6
3 9
The user submits a list of Activities from checkboxes on a form. I want to be able to find only the GroupID's that contain all of the Activities in the list rather than any of them. So if the list passed from the checkbox form is (2,6,7) I want the query to return only GroupID 1. The IN query returns GroupID 1,2 and 3. If the list is (2,8,9) then there should not be any GroupID's returned. I have been having a lot of trouble with this and just can't get it to work correctly. If anybody has any suggestions or thoughts on how would be best to accomplish this I would greatly appreciate it.
Regards,
Roy F.