I'm using CR 9 and MS Access database. I use the following formula to select 5 random numbers based on the total count of records in each group:
WhilePrintingRecords;
numberVar array RandomArray := [1, 2, 3, 4, 5];
numberVar i;
For i := 1 To 5 Do (
RandomArray := Truncate (Rnd * Count ({someTable.someField}, {@StringToDate}, "daily"));
)
where Count ({someTable.someField}, {@StringToDate}, "daily") = the total number of records in a group, and each group is an appointment date.
Then I'm stuck here and don't know how to proceed. Does anyone how to apply any random formula to record selection to print out only 5 random records for each group?
Thanks.
WhilePrintingRecords;
numberVar array RandomArray := [1, 2, 3, 4, 5];
numberVar i;
For i := 1 To 5 Do (
RandomArray := Truncate (Rnd * Count ({someTable.someField}, {@StringToDate}, "daily"));
)
where Count ({someTable.someField}, {@StringToDate}, "daily") = the total number of records in a group, and each group is an appointment date.
Then I'm stuck here and don't know how to proceed. Does anyone how to apply any random formula to record selection to print out only 5 random records for each group?
Thanks.