Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To get Random values from a dbf.
Message
De
31/03/2004 12:09:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/03/2004 04:58:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00890690
Message ID:
00891205
Vues:
16
>Dear Experts,
>
>I have a table, entitled abc, fields as follows
>sno n(3)
>figure n(5)
>
>The data of the table is as
>
>sno figure
>1 14587
>2 84871
>3 36548
>4 95972
>5 64788
>
>Now I want to brows only three records randomly from the dbf,such as 84871,95972,14587. What should be the source codes behind a click button?
>
>Please help

Tarik,
If you reply here me and everybody else have a much higher chance to reply. I rarely check my emails but could hear notification sounds from here :)
"...
rand(-1)
select top 3 rand(), * from myTable order by 1

Cetin

Sir, when I run it, the brows windows shows two fields as
Exp_1 and Figure.
The Exp_1 field has values as
0.17
0.36
0.43

There must be only one field in brows window.

Please suggest another method..."

rand(-1)
select top 3 rand(), * from myTable order by 1 into cursor crsRandom
Browse fields Figure

Would show only field.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform