Print Page | Close Window

random records

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=23000
Printed Date: 05 May 2024 at 5:45pm


Topic: random records
Posted By: sanchezgmc06
Subject: random records
Date Posted: 10 Mar 2022 at 12:31pm
Hello

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

Using SQL querey



Replies:
Posted By: kevlray
Date Posted: 14 Mar 2022 at 4:18am
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.


Posted By: lockwelle
Date Posted: 14 Mar 2022 at 5:38am
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.




Print Page | Close Window