[AccessD] Random ina query

Jim Dettman jimdettman at verizon.net
Fri May 15 10:42:19 CDT 2009


  I forgot to add a field to the call, but otherwise, that will work. With
it defined as I posted, it would get called once at the start of the query.
It needs to be Rnd([<fieldname>]).   If you don't have a non-zero numeric
field, you can do Rnd(Len([<field name>])

  But other then that, it does work.

Jim.

  

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Friday, May 15, 2009 11:25 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Random ina query

Hi Jim

Not you! I've posted that code many times here and 14 times at [you know
where] since 2004.

I even found my function here (with left out credits of course):

  http://www.vbforums.com/showthread.php?t=388276

/gustav


>>> jimdettman at verizon.net 15-05-2009 17:07:48 >>>

  Yup.  Define a column as Rnd(1), sort on that column and set the TOP
predicate for the query for the number of records you want.



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list