Add Custom Counter to a Query

L

Lucky

I need to add a field (column) to my query that

I need to create a counter in my query that count from 1
to 10 and than resets back to 1. This counter will be
added to the end of any query. There is no particular
index, primary key or other field it is based on, it just
needs to show.

Here is an example (based on Order Detail – Nothwind dbs):
Order ID Product Counter
10248 Queso Cabrales 1
10248 Singaporean Fried Meet 2
10248 Mozzarella di Giovanni 3
10249 Tofu 4
10249 Manjimup Dried Apples 5
10250 Jack's New England Chowder 6
10250 Manjimup Dried Apples 7
10250 Louisiana Pepper Sauce 8
10251 Gustaf's Knäckebröd 9
10251 Ravioli Angelo 10
10251 Louisiana Fiery Sauce 1
10252 Sir Rodney's Marmalade 2
10252 Geitost 3
10252 Camembert Pierrot 4
10253 Gorgonzola Telino 5
10253 Chartreuse verte 6
10253 Maxilaku 7
10254 Guaraná Fantástica 8
10254 Pâté chinois 9
10254 Longlife Tofu 10
10255 Chang 1

Any help is greatly appreciated. Thank you.

Lucky
 
L

Lucky

Unfortunately, it needs to be done in the query for
further data processing.

But just for my own information, how would you do it in
the report?

Lucky
 
L

Lucky

That worked great. I am still searching for the query
version.

Thank you for your help.
 
Top