I'm trying to figure out a way of adding a counter field to a table that increments based on the values in another field, e.g.
Field A
1
1
1
2
2
8
12
12
12
The result I need should look like:-
Field A Field B
1 1
1 2
1 3
2 1
2 2
8 1
12 1
12 2
12 3
So the counter breaks and restarts based on a change in Field A.
I don't know whether I can do this inside a query or whether I need to write a module. If the latter, I've no idea how to write it.
Any assistance would be greatly appreciated.
Many thanks,
Mark
Field A
1
1
1
2
2
8
12
12
12
The result I need should look like:-
Field A Field B
1 1
1 2
1 3
2 1
2 2
8 1
12 1
12 2
12 3
So the counter breaks and restarts based on a change in Field A.
I don't know whether I can do this inside a query or whether I need to write a module. If the latter, I've no idea how to write it.
Any assistance would be greatly appreciated.
Many thanks,
Mark