Unique Identifier for each row of a query?

  • Thread starter Thread starter Chad Chenoweth
  • Start date Start date
C

Chad Chenoweth

Hello,

I have a question about Microsoft Access queries. Is there a way to create
a unique identifier for each row of a query WITHOUT using VB code? I need a
way of using only SQL functions. Does the database create a unique
identifier behind the scenes that I can get to?

Thanks,

-- Chad
 
Hi,


Append the data to a table having an autoincrement field.



Hoping it may help,
Vanderghast, Access MVP
 
I don't want duplicate data. I need the query to be dynamic with no
temporary tables.
 
Hi,

In Access? have a call to MyFunction( someFieldName) as computed
column, and, in a module:


Public Function MyFunction( Arg as Variant) As Long
Static x As long
x=x+1
MyFunction = x
End Function



or even better, a computed column like: Rnd( someNumericalField )


which supplies a different random number for each row ( you have to specify
a field as argument, else the expression is a considered a "constant", by
the query optimizer, and evaluated just once, at the beginning of the
query).



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top