Firstly, apologies if this is vague or if someone answered a similar question elsewhere. I'm having trouble describing what I want which also makes it hard to search for answers!
I want to run an update query that will basically count the values of a given type in Field1, and based on that count, add a sequential letter to Field2.
Example, the table "Old_McDonald" has data like so:
Farm Animal Animal_Subrow illinois chicken illinois sheep illinois sheep iowa chicken iowa goat indiana goat indiana goat
After I run the update query I want it to look like this:
Farm Animal Animal_Subrow
illinois chicken illinois sheep a illinois sheep b iowa chicken iowa goat indiana goat a indiana goat b
If there was a 3rd indiana goat in the table it would get "c" under animal_subrow, and so on. So basically if Count of Farm x Animal =< 1 then = blank, if Count of Farm x Animal = 2 then "a" for the first and "b" for the second... etc.
Sorry for the dumb analogy. I can get a Crosstab query to work that has Farm as the row heading, Animal as Column Heading, and then Count of Animal as value:
TRANSFORM Count(Tbl_OldMcDonald.Animal) AS CountOfAnimal
SELECT [Tbl_OldMcDonald]![Farm]
FROM Tbl_OldMcDonald
GROUP BY [Tbl_OldMcDonald]![Animal] & [Tbl_OldMcDonald]![Farm]
PIVOT Tbl_OldMcDonald.Animal;
...and I was thinking of referencing this count value to a simple table like:
ID Letter 1 2 a 3 b 4 c etc
But my brain stops there.
Help?
Thanks,
Will
PS, the count will never go beyond 26 (or past the letter z in my table).