Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Random records


gustavoa

Recommended Posts

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??

Link to comment
Share on other sites

  • 1 month later...

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]

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use