Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate specific # of random results

Status
Not open for further replies.

thatgirl100

Technical User
Oct 19, 2005
18
CA
Hello,

I am looking to randomly generate a certain number of records from a report. The user wants to take 25 random records for each PHARMACY #, OR 10% of the records (whichever is less), so it is not always the same number of random records I want to generate.

I read a post from 2004, but am wondering if there are any futher ideas on this topic. Why can't Impromptu just have the RAND() function? :)

I have one report that shows all the detailed records.
I have a 2nd report that calculates 10% of the records for each PHARMACY #, and another calculated field showing how many recs I want to take (IF(10%rec < 25) then (10%rec) else (25)).

Now I just need to figure out how to generate the recs randomly and reference my calculated field to grab the correct number of records.

Thanks so much for any help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top