Re: How can I "ORDER BY RANDOM" ?

2003-04-04 Thread Jochem van Dieten
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Costas Piliotis
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread cf-talk
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"

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Jim McAtee
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread ksuh
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
> 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, >

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Matthew Walker
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Benjamin S. Rogers
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Benjamin S. Rogers
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread ksuh
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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. >

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Bryan Stevenson
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Tom Forbes
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

RE: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Russ
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread David Groth
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

Re: How can I "ORDER BY RANDOM" ?

2003-04-03 Thread Bryan Stevenson
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] --