random order results from MS access database

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default random order results from MS access database

    simple question but how could I go about order by search results randomly every
    time the page loads, or even better set it up so that each time the page load
    it orders the list ascending -1 incrementally. ex: first time the page loads
    returned order; a Company b Company c Company d Company Second time the page
    loads returned order; b Company c Company d Company a Company thid time the
    page loads returned order; c Company d Company a Company b Company Any
    Suggestions

    bawaite Guest

  2. Similar Questions and Discussions

    1. Order by results of count using 'group by'
      Hi there, I'm querying a single table with the goal of selecting the number of distinct cities of the field 'city' where the count is greater...
    2. Display dataset results in a random order
      I'm connecting to an MS Access database to retireve my data and wan to display my results in a random order. What i have is a table containing...
    3. Random cfldap results
      Using this script <cfsetting requestTimeout = "7200"> <cfset FromDate = "2004-08-15"> <cfldap action="QUERY" name="getActiveStudents"...
    4. Form Results Order
      Created two web forms with the results being emailed to me and this actually works well, but the results in the email aren't in the order they are...
    5. Presenting a list in random order
      I have a client with 150+ employees, who wants a line for each of them on the corporate website I'm building, but he wants them presented in random...
  3. #2

    Default Re: random order results from MS access database

    Not sure how you can do this within the query, if you are displaying the
    results using CF you can do a CFLOOP or CFOUTPUT starting at a certain row eg 5
    and output till query.recordcount and then CFLOOP/CFOUTPUT from rows 1 to 4.

    You could save the number that you start at eg. 5 in a session variable and
    increment it each reload. or use a random number generator to choose a number
    between 1 and query.recordcount on each refresh of the page.

    - Zoe

    zoeski80 Guest

  4. #3

    Default Re: random order results from MS access database

    Hi!
    i have an idea which may be useful to u.
    suppose query returned 10 records. first time when the page is loaded show the
    alternate records i.e 1,3,5,7,9,2,4,6,7,10. in this case the counter is 2. next
    time the page is loaded this counter should be other the previous(2), i.e.,
    1,4,7,10,2,5,8,3,6,9. in this case the counter is 3. and so on. these counters
    may be of ur choice or u may randomly generate it.
    i have other idea for this. if ur table has more than one column, then every
    time page is reloaded use a different column in 'order by' clause.
    Hope this will fulfill ur requirement.


    vkunirs Guest

  5. #4

    Default Re: random order results from MS access database

    Thank you for your suggestions, what I will be doing for the time beeing
    becuase the client wants a complete random where there is not oreder to it, I
    have it setup so that it creates a random list of of the order of the contents
    for the query useing the record count: 10 records 2,5,9,1,3,7,4,10,6,8 Thank
    you for your suggestions

    bawaite Guest

  6. #5

    Default Re: random order results from MS access database

    Thank you for your suggestions, what I will be doing for the time beeing
    becuase the client wants a complete random where there is not oreder to it, I
    have it setup so that it creates a random list of of the order of the contents
    for the query useing the record count: 10 records 2,5,9,1,3,7,4,10,6,8 Thank
    you for your suggestions

    bawaite Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139