Heenan, Lambert
Lambert.Heenan at AIG.com
Wed Oct 26 15:53:09 CDT 2005
Looks like that would be very simple to do... Ever needed to grab a selection of random rows from a table? Well, it's surprisingly easy in SQL Server 2000, using the NEWID() method. The code below selects 10 random rows from "myTable". SELECT TOP 10 id,title FROM myTable ORDER BY NEWID() Great! See http://www.developerfusion.co.uk/show/4680/ for the source of this tip. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, October 26, 2005 4:11 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A2003: Random order OK. Then I guess it is about how to emulate VBA's rnd() function on MS SQL using NewId()? It isn't publicly available? Shamil ----- Original Message ----- From: "Susan Harkins" <harkinsss at bellsouth.net> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Sent: Wednesday, October 26, 2005 11:46 PM Subject: Re: [AccessD] A2003: Random order > Nope, not the same article Shamil. The article I sent Steve was about > the differences between producing random values in Access and SQL > Server. > > Susan H. > > <<< > Susan sent me an article she'd written with Arthur Fuller > >>>