What will you do with this number?
I don't think it is very easy to have a query return such a value for each record as a spreadsheet can do.
But, you can have your numbers in the output of your query.
ie, If you are running a report, then add a Running Sum control to your report.
If you Create a Table (could be Temporary) or append data to a table then you can have the table provide the numbers.
If you want the count of records then a query can return this.
Maybe one of the more experienced forum members will have better advice.