I have an access database with the following format:
ID | Period | Data
---------------------
13 | 1 | xxxxx
13 | 2 | xxxxx
25 | 1 | xxxxx
25 | 2 | xxxxx
25 | 3 | xxxxx
52 | 1 | xxxxx
52 | 3 | xxxxx
94 | 1 | xxxxx
94 | 2 | xxxxx
94 | 3 | xxxxx
The Period can be 1, 2, or 3. I need to get a count of the IDs that have a period of 1, 2, and 3, or periods 1 and 2, or 1 and 3 (they always have period 1). How can I run such a query - it can be 3 different queries to hit the different permutations. The results would be like the following:
Periods 1, 2, and 3: Count: 2 (for IDs 25 and 94, although I don't necessarily need the IDs returned, just the count)
Periods 1 and 2: Count: 1 (ID 13)
Periods 1 and 3: Count: 1 (ID 52)
Is this possible with Access? It's not quite distinct values, so this question and the linked article don't seem to provide enough help. I don't have the database yet which is why I can't test that query, but I want to know if it would be possible before creating the table or if I need to find another solution.