Randomizing sort options

Results 1 to 2 of 2

Thread: Randomizing sort options

  1. #1
    Join Date
    Dec 1969

    Default Randomizing sort options

    I would like to write a quick little routine that would allow me to randomize the value of my "sortby" variable between two options. Every time the page loads I want the value of "sortby" to randomize between "EDate" and "Author".<BR><BR>I&#039m sure this is easy, but I don&#039t have a clue of how to do it.

  2. #2
    peterjl@austec.net.au Guest

    Default RE: Randomizing sort options

    &#060;%<BR>dim qryString, SortOpt<BR>ramdomize<BR>SortOpt=array("EDate","Aut hor")(int(Rnd * 2))<BR>qryString = "Select * from YourTable order by " & SortOpt<BR>%&#062;<BR><BR>Then open a recordset with the SQL query command in qryString.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts