Try this:
1. Pull back the query unsorted.
2. Create a while-do loop that picks a random record from the query
3. Display the record
4. Delete the record from the record set
5. Go back to step 2.
Kevin
>>> [EMAIL PROTECTED] 07/10/01 03:44PM >>>
Dear Cf'ers:
I have the below query that gets companies alphabetically (stupid, eh?) -
the problem is, the companies don't like it because, being ordered by
company name, it gives preference to those that begin with the first
letters of the alphabet. Can anyone think of a way to order this list in a
random fashion each time it is envoked??
Thank you all for your consideration.
Tom
<CFQUERY NAME="GetAllCompaniesForThisCategory" DATASOURCE="MedMallDs"
DBTYPE="ODBC">
SELECT DISTINCT
JoinTbl.CategoryID, JoinTbl.CompanyID, CategoryTbl.CategoryName,
CategoryTbl.CategoryID, CompanyTbl.CompanyID, CompanyTbl.CompanyName,
CompanyTbl.WebAddress
FROM CategoryTbl, JoinTbl, CompanyTbl
WHERE
JoinTbl.CategoryID = CategoryTbl.CategoryID AND
JoinTbl.CompanyID = CompanyTbl.CompanyID AND
JoinTbl.CategoryID = #CategoryID# AND CompanyTbl.WebAddress IS NOT NULL
ORDER BY CompanyTbl.CompanyName
</CFQUERY>
*****************************************************************
MedMatrix New & Used Medical Equipment Web Portal
http://www.medmatrix.com
V:(407) 772-3427 F:(407) 772-3428
Tom Forbes, Forbes Web Consulting, Inc.
178 S. Monterey Isle Blvd., Longwood, FL - 32779
*****************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists