gustavoa Posted April 26, 2002 Share Posted April 26, 2002 Hi, I´ve a little question: Background: I was develop a exam system for faculty use in my university, the system contains 3 databases: Students, Questions, Results, the Questions database contains up to 1000 records. Problem: the user logs in, and i want to return 10 random records from questions database, how do I?? Quote Link to comment Share on other sites More sharing options...
coolboy7163 Posted June 10, 2002 Share Posted June 10, 2002 Good question Quote Link to comment Share on other sites More sharing options...
dj Posted June 10, 2002 Share Posted June 10, 2002 Hi, create an unique ID (if you don't already have it) for question's records amd make it serial text field. Also create an global text field gID and one global num field i. Than create an auto relationship in Question Quest::gID-->ID At last create an script Set Field["i", 10] Set Field["gID", ""] Loop Set Field ["gID","gID & NumToText (Int (Random*Status (CurrentRecordCount))) & "¶""] Set Field["i", "i-1"] Exit loop If["i=0"] End Loop Go To Realated Record[show only related,"Quest"] Exit Record HTH Dj Originally posted by gustavoa:[qb]Hi, I´ve a little question: Background: I was develop a exam system for faculty use in my university, the system contains 3 databases: Students, Questions, Results, the Questions database contains up to 1000 records. Problem: the user logs in, and i want to return 10 random records from questions database, how do I??[/qb] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.