Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random records
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00935859
Message ID:
00935954
Views:
23
Frank,
rand(-1) & seed the randomw number generator

select top 10 rand() as randkey, * ;
   from ... ;
   order by 1
Although in VFP it's possible that you will get more than 10 rows if ties are involved so you need to check for that condition. VFP9 will fix this problem.

>By any chance anyone knows of a routine/function similar to that in sql, newid(), to generate random records from a table in vfp?
>
>The sql select statement, select top 10 id from tblTest order by newid()
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform