Thanks for the tip Tom! I've been looking for a way to do that for months!!!
 
Jordan

"Schreck, Tom" <[EMAIL PROTECTED]> wrote:
Yep, that's what I'm talking about. If you need a single randomally
selected value you would do this:

Select TOP 1 fieldname from tablename
order by newid()

Thanks

Tom Schreck
972-361-9943

-----Original Message-----
From: Galen M. Smallen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 05, 2005 7:38 AM
To: [email protected]
Subject: RE: Random Number Generator...

I thought that

select fieldname from tablename
order by newid()

Would bring back random record(s) in random order in MS SQL Server.

----------------------
Galen M. Smallen
VP, CTO
ZoeMed, Inc.

mailto:[EMAIL PROTECTED]
http://www.zoemed.com



> >-----Original Message-----
> >From: [EMAIL PROTECTED]
> >[mailto:[EMAIL PROTECTED] On Behalf Of Schreck, Tom
> >Se nt: Wednesday, January 05, 2005 7:17 AM
> >To: [email protected]
> >Subject: RE: Random Number Generator...
> >
> >
> >Why not place a unique constraint on your companyID field in
> >your database? Do you need to randomly select a company from
> >your company table? If so, I have a cool way of doing that
> >via a SQL Select statement.
> >
> >Thanks
> >
> >Tom Schreck
> >972-361-9943
> >
> >-----Original Message-----
> >From: Alford, Gary L [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, January 05, 2005 7:10 AM
> >To: DFW ColdFusion Users Group (E-mail)
> >Subject: Random Number Generator...
> >
> >I am currently running a random number generator and
> >assigning it to a variable as follows:
> >
> > > >#RandRange(100, 999)#>
> >
> >The problem is that there will always be the possibility of
> >duplication. I would like to run a > >the Company IDs from the table in order to double check for
> >duplication. If a duplication is found, how can I cause the
> >random number generator to run again and recheck for
> >duplication without reloading the entire page?
> >
> > _____
> >
> >Gary L. Alford
> >Manufacturing Operations Project Specialist
> >Bell Helicopter XWorx
> >Phone: (817) 280-6233 Fax: (817) 278-6233
> >[EMAIL PROTECTED]
> >
> >
> >I have not failed. I've found 10,000 ways that won't work.
> > Thomas A. Edison
> > _____
> >
> >----------------------------------------------------------
> >To post, send email to [email protected]
> >To unsubscribe:
> > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> >To subscribe:
> > http://www.dfwcfug.org/form_MemberRegistration.cfm
> >
> >----------------------------------------------------------
> >To post, send email to [email protected]
> >To unsubscribe:
> > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> >To subscribe:
> > http://www.dfwcfug.org/form_MemberRegistration.cfm
> >
> >

----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
http://www.dfwcfug.org/form_MemberRegistration.cfm

----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
http://www.dfwcfug.org/form_MemberRegistration.cfm




 

Reply via email to