Autonumber

  • Thread starter Thread starter PAP
  • Start date Start date
P

PAP

I have created a query with specific data in it. I want
to create an expression (or something) that gives me
an 'autonumber' always starting at 1 and ascending by 1
for each entry within my query.

Please help! It seems as if this should be easy but I
can't do it!!
 
Dear PAP:

This is commonly referred to as a "ranking" of the rows in the query.
In order to implement this, you must define an ordering of the rows.
Probably you will want them displayed so the rank column starts with 1
at the top and proceeds down from there.

It will not be possible to uniquely rank rows if the ordering is not
unique. Ties in the ordering result in ties in the ranking, just like
in a horse race. Two horses crossing the finish simultaneously can
result in two first place finishers (rank = 1) followed by a third
place finisher (rank = 3) skipping second place.

Please post a query here showing everything except the rank column,
including an ORDER BY clause on which the ranking can be based. I'll
try to add the ranking you want.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Following, I've pasted an answer from a conversation yesterday here that
could
meet what you are looking for. Query posted is based on using a subquery,
you can check the SQL and adapt to your purposes:

Hope being helpful

Tonín



===========================
 
Back
Top