Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compute many operations
Message
 
 
À
08/09/2004 14:22:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00939290
Message ID:
00940383
Vues:
22
>hi,
>thank you very much
>it's ok. just step 3 ,not skip i must take this records
>
>thanks .
>
>best regards
>m.qasem

Ok, this piece needs to be changed:
lnNumberToExtract = curPercentage.NumToFetch
    lnAreaCode = curPercentage.AreaCode
    lnTeam = curPercentage.Team

   ** Now use code from Sergey Berezniker (Al Doman) - may be not efficient, but quite elegant
    SELECT TOP lnNumberToExtract *, RECNO() AS rn,  ;
   ROUND(RAND()*10000000000,0) AS ord ;
    FROM table1 ;
    WHERE AreaCode = m.lnAreaCode and Team = m.lnTeam ;
    ORDER BY ord ;
    INTO CURSOR crsRand
to the following:
lnAreaCode = curPercentage.AreaCode
lnTeam = curPercentage.Team

lnNumberToExtract = curPercentage.NumToFetch
if m.lnNumberToExtract<curPercentage.TeamCount    
   ** Now use code from Sergey Berezniker (Al Doman) - may be not efficient, but quite elegant
    SELECT TOP lnNumberToExtract *, RECNO() AS rn,  ;
   ROUND(RAND()*10000000000,0) AS ord ;
    FROM table1 ;
    WHERE AreaCode = m.lnAreaCode and Team = m.lnTeam ;
    ORDER BY ord ;
    INTO CURSOR crsRand
else && we exceed original number of records, just select all records for that team
   select * from table1 WHERE AreaCode = m.lnAreaCode and Team = m.lnTeam into cursor crsRand NOFILTER
endif
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform