Ask a Question related to Coldfusion Database Access, Design and Development.
-
bawaite #1
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
-
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... -
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... -
Random cfldap results
Using this script <cfsetting requestTimeout = "7200"> <cfset FromDate = "2004-08-15"> <cfldap action="QUERY" name="getActiveStudents"... -
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... -
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... -
zoeski80 #2
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
-
vkunirs #3
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
-
bawaite #4
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
-
bawaite #5
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



Reply With Quote

