Autonumber in Query

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

Is there a way to generate and display a unique number in
a select query? Every time when the query is executed,
the number starts from 1. What I want is to have a unique
value to identify each query row.

One possible way is to add an autonumber field in the
table but I do not want to change the table structure.

Thanks and regards,
Kevin
 
There may be a simpler way to do that using Rnd() or something, but if you can settle with a read-only query that will number each row in the query, check out the two threads from yesterday entitled "Displaying row no/Record Counting" and "Top values in aggregate queries".

If there are two fields in the query that, between them, will always be unique, you could probably combine them and use the result to generate a random number... But I'm afraid I'm just guessing here -- if the above doesn't give you what you need, you might be better off waiting for a post with a simpler soution.

HTH,

Dave
 
Back
Top