I am using Microsoft Access (2016) and want to calculate how many fields within a record contain the same value. How do I do that?
All the count functions I have researched instead determine how many records contain fields of a certain value. I am kind of trying to do the opposite.
Let's say I have a table with 4 fields. Each field has an integer between 1 and 5. Let's call them Field A, Field B, Field C, and Field D.
I want to create 5 additional fields that count how many 1s, 2s, 3s, 4s, and 5s there are in the first 4 fields. So, one record could look like this:
Field A: 2
Field B: 5
Field C: 5
Field D: 1
Fields A to D 1 Count: 1
Fields A to D 2 Count : 1
Fields A to D 3 Count: 0
Fields A to D 4 Count: 0
Fields A to D 5 Count: 2
I imagine it is some sort of calculated field, or perhaps derived by a query, or some combination of that. But I can't figure out how to formulate it.
Thanks,
Davin