random records

Printed From: Crystal Reports Book — Forum Name: Technical Questions

Hello

Is there a way to select 20 random records from a table?

Using SQL querey

Edited by sanchezgmc06 - 10 Mar 2022 at 12:32pm
I have seen code where 'random' records could be pulled from the data. But it has been a long time and I would have to do some research (on the internet) to see if I could find the code again.  Also I am not sure if is truly random or just sampling the data.
You can use Rand()...You should seed it with a value that changes every record. You will need to manipulate a little.

I cannot seem to post a snippet, you will have to Google it.