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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Selector Again

Status
Not open for further replies.

ecugrad

MIS
Apr 17, 2001
191
US
I've been asked to add to my random record selector which selects 5% of accounts from each employees Queues for auditing purposes: With some help from the Experts I have set up a running total field. And put the below in the detail section of the record selector.

If Count ({PROCESSLOG.QUEUENAME}, {PROCESSLOG.QUEUENAME}) = 1 Then
RecordNumber *1 <> int(RecordNumber *1)
.

.

If
Count ({PROCESSLOG.QUEUENAME}, {PROCESSLOG.QUEUENAME}) >20 Then
RecordNumber *.05 <> int(RecordNumber *.05)


This allows me to mimick a random record selector by taking 5% of record returns over 20, under 20 I select one record to be displayed for employee per queue. I sort on the 5th digit of the account number.

( mid(({PROCESSLOG.ACCOUNTNO}),5,1)

My problem is my boss wants different records each time he runs the query, the below will always return the same records. I have this function rnd(rnd({#Count})*1) which gives me a random value, but I can't sort on it.. I think because it is not a database field.

Any suggestions, will GREATLY be appreciated..



 
synapsevampire, I appreciated your post and referenced the funtion above, I'm just not sure how to use it. I have the function giving me a random number. But, like I stated above, How do I sort on the function or how do I use it in the record selector. Do I place my account number field in the function, the #Count is the running total field..

rnd(rnd({#Count})*1)

Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top