Tom Forbes wrote:
>
> I need to modify the below query so that my results are still ordered by
> "ClassOfService" (a number between 1 and 4) - BUT, the "CompanyName" needs
> to be displayed in a RANDOM ORDER each time the query is run, rather than
> its current alphabetical order. This will giv
Nice! Great idea!!! Very clever...
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 4:42 PM
To: CF-Talk
Subject: Re: How can I "ORDER BY RANDOM" ?
I don't think I've seen this mentioned yet. Another way you can
l, I've done it on 1,000 records or so
without any problems.
-Novak
- Original Message -
From: "Tom Forbes" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, April 03, 2003 2:44 PM
Subject: RE: How can I "ORDER BY RANDOM"
essage -
>From: "Tom Forbes" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Thursday, April 03, 2003 4:11 PM
>Subject: RE: How can I "ORDER BY RANDOM" ?
>
>
> > This method does return a random order, but there sho
eing the expected number of records, I'd examint the WHERE
clause, as the sort order should have no effect on this.
Jim
- Original Message -
From: "Tom Forbes" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, April 03, 2003 4:11 PM
I use Access 97
At 04:19 PM 4/3/03 -0700, you wrote:
>Ahh, I see. You want the rows to be randomized.
>
>What DB are you using?
>
>- Original Message -
>From: Tom Forbes <[EMAIL PROTECTED]>
>Date: Thursday, April 3, 2003 4:05 pm
>Subject: Re: How can I &q
Hi Benjamin,
Thanks for the good sql resource. I looked at the 7 articles, the ones that
pertain to Access are dead links. I have Access DB.
But, this site will come in very handy for other queries. Thanks very much!
Tom
At 05:33 PM 4/3/03 -0500, you wrote:
>A quick search produced this list
Ahh, I see. You want the rows to be randomized.
What DB are you using?
- Original Message -
From: Tom Forbes <[EMAIL PROTECTED]>
Date: Thursday, April 3, 2003 4:05 pm
Subject: Re: How can I "ORDER BY RANDOM" ?
> Thanks, I tried this, and it DOES return a list in a ra
> ORDER BY NEWID()
>
>
>
> > -Original Message-
> > From: Tom Forbes [mailto:[EMAIL PROTECTED]
> > Sent: Friday, 4 April 2003 10:45 a.m.
> > To: CF-Talk
> > Subject: RE: How can I "ORDER BY RANDOM" ?
> >
> > Hi Russ,
>
PM 4/3/03 -0700, you wrote:
>Leave your query the same.
>
>Do something like:
>
>
>
>
> {do processing here}
>
>
>- Original Message -
>From: Tom Forbes <[EMAIL PROTECTED]>
>Date: Thursday, April 3, 2003 3:30 pm
>Subject: Re: How can I
row. I
know this works in SQL Server:
SELECT*
FROM myTable
ORDER BY NEWID()
> -Original Message-
> From: Tom Forbes [mailto:[EMAIL PROTECTED]
> Sent: Friday, 4 April 2003 10:45 a.m.
> To: CF-Talk
> Subject: RE: How can I "ORDER BY RAN
I have version 4.5
Tom
At 03:09 PM 4/3/03 -0700, you wrote:
>Ivan Latunov ([EMAIL PROTECTED]) wrote a great UDF for doing that with an
>array, called ArrayShuffle (http://www.cflib.org/udf.cfm?ID=292). You
>write the companys into an array, and then it shuffles them. (I did a
>similar thing he
Hi Russ,
I did that, but I get an error stating that there is no column in the db
named SortOrder. Here is the modified query:
SELECT CompanyTbl.*, Rnd() as SortOrder
FROM CompanyTbl
WHERE CompanyWantsMiniSite = 'Yes' AND MakeMiniSitePublic = 'Yes'
ORDER BY C
A quick search produced this list of articles:
http://www.sqlteam.com/FilterTopics.asp?TopicID=135
Benjamin S. Rogers
http://www.c4.net/
v.508.240.0051
f.508.240.0057
-Original Message-
From: Tom Forbes [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 5:06 PM
To: CF-Talk
Subject
Bryan Stevenson [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 5:12 PM
To: CF-Talk
Subject: Re: How can I "ORDER BY RANDOM" ?
Remove the CompanyName field from the ORDER BY clause. Then the results
will be ordered by ClassOfService onlyunless I'm missing your point
;-)
Br
Leave your query the same.
Do something like:
{do processing here}
- Original Message -
From: Tom Forbes <[EMAIL PROTECTED]>
Date: Thursday, April 3, 2003 3:30 pm
Subject: Re: How can I "ORDER BY RANDOM" ?
> I know, I stated in my question that I w
gt;To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Thursday, April 03, 2003 2:16 PM
>Subject: Re: How can I "ORDER BY RANDOM" ?
>
>
> > Bryan,
> >
> > I need to display the company names in a random order EACH TIME the query
> > is run.
>
ctor
www.cfug-vancouverisland.com
- Original Message -
From: "Tom Forbes" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, April 03, 2003 2:16 PM
Subject: Re: How can I "ORDER BY RANDOM" ?
> Bryan,
>
> I need to display
Bryan,
I need to display the company names in a random order EACH TIME the query
is run.
Thanks,
Tom
At 02:12 PM 4/3/03 -0800, you wrote:
>Remove the CompanyName field from the ORDER BY clause. Then the results
>will be ordered by ClassOfService onlyunless I'm missing your point ;-)
>
>B
If your database has a random number generator function, you can try:
SELECT tblCompany.*, Random() as SortOrder FROM tblCompany ORDER by
SortOrder
HTH--haven't tried it myself.
Russ
> -Original Message-
> From: Tom Forbes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 03, 2003 4:06
Ivan Latunov ([EMAIL PROTECTED]) wrote a great UDF for doing that with an
array, called ArrayShuffle (http://www.cflib.org/udf.cfm?ID=292). You
write the companys into an array, and then it shuffles them. (I did a
similar thing here
(http://hscwebdev.unm.edu/webdev/staff/groth/hogwash_form.cfm) t
Remove the CompanyName field from the ORDER BY clause. Then the results
will be ordered by ClassOfService onlyunless I'm missing your point ;-)
Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]
--
22 matches
Mail list logo