I am creating a query in MS Access that needs to update newly created field with the total number of previous records. Something like this:
Original table:
| ID | Name |
--------------
| 1 | Mark |
--------------
| 2 | Mich |
--------------
| 3 | Isak |
--------------
Now I add another column ( of type int
), e.g. Ordinal_Number
:
| ID | Name | Ordinal_Number |
-------------------------------
| 1 | Mark | |
-------------------------------
| 2 | Mich | |
-------------------------------
| 3 | Isak | |
-------------------------------
Now I need to fill Ordinal_Number
with the number of previous records :
| ID | Name | Ordinal_Number |
-------------------------------
| 1 | Mark | 0 |
-------------------------------
| 2 | Mich | 1 |
-------------------------------
| 3 | Isac | 2 |
-------------------------------
I couldn't even get the idea how to try fighting this problem so I am asking here.