autonumber

  • Thread starter OTWarrior via AccessMonster.com
  • Start date
O

OTWarrior via AccessMonster.com

is there a way of having an incremental number for each row of a query, like
an autonumber?
 
M

Marshall Barton

OTWarrior said:
is there a way of having an incremental number for each row of a query, like
an autonumber?


Well, you can do that, if the records an be sorted in a
unique (no ties) order, but, since the numbers will be
recalculated every time the query is run, what good are
they.

Given that you have a field that can be used for the unique
sort order, use a subquery in the calculated field:

IncNum: (SELECT Count(*) FROM thetable As X WHERE
X.sortfield <= thetable.sortfield)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top