Randomly select a record in a table

  • Thread starter Thread starter DontKnow
  • Start date Start date
D

DontKnow

Hi Guys,

How would I randomly select a record from a table that has some 2500 records?

Any help is greatly assisted!!

many thanks in adavnce!!

Cheers
 
Hi Guys,

How would I randomly select a record from a table that has some 2500 records?

Any help is greatly assisted!!

many thanks in adavnce!!

Cheers


SELECT TOP 1 *
FROM Yourtable
ORDER BY Rnd([fieldname])

where [fieldname] is some Number or Autonumber field which can be counted on
to contain a positive number.
 
Beautiful John!!

Many thanks!!

Cheers!!

John W. Vinson said:
Hi Guys,

How would I randomly select a record from a table that has some 2500 records?

Any help is greatly assisted!!

many thanks in adavnce!!

Cheers


SELECT TOP 1 *
FROM Yourtable
ORDER BY Rnd([fieldname])

where [fieldname] is some Number or Autonumber field which can be counted on
to contain a positive number.
 
Back
Top