Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random and compare
Message
De
06/01/2006 07:19:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01083037
Message ID:
01083963
Vues:
30
hi,
thank you for reply,
what i need, all steps under, at one command button if it possiple?

1.table allbook1 is Accumulated Table have field(account1)
2.table afm have field(char4),have same data as allbook1.account1
3.table newafm empty table have the same fields as afm,
i want to compare between allbook1(account1) and afm(char4)
append all records not found at allbook1(account1) into newafm,
between 2 date,mean set filter, or select from allbook1 between 2 date
where char4<>account1....
via this code
startdate=thisform.text1.value
enddate=thisform.text2.value
****
INSERT INTO newafm ; 
SELECT * FROM allbook1.account1 NOT IN (SELECT char4 FROM afm)

ex...where allbbok1.dat between startdate and enddate
4.table newafm ,field(char4) have data as llp3256987 and 0652147
i need all records have char4 as 0652147,06985471......
via this code
use newafm
set filter val(char4)>0
5.i need to get 2401 randomly records from newafm,insert it at table(dncc)
via this code under
USE newafm
total = "2401"
RAND(-1)
INDEX ON RAND() TO SYS(2023)+'\RANDOM'
COPY TO dncc NEXT &total
SET INDEX TO
ERASE SYS(2023)+'\RANDOM'
      CLEAR EVENTS
ELSE
   =MESSAGEBOX("no file/ or data")
ENDIF
thank you.
have anice time


>The code looks okay.
>
>What is the purpose of this service.
>
>You can generate a random cursor of records from one file based on a defined date range. The number of records selected between the date range is 2401.
>
>Next you want do go through the random table and match it to what in the second table.
>
* Here is the do while for the random ordered date range file
>USE RandomDateRangeTable
>go top
>do while !EOF
>* Heres where I get lost
>locate "?what?" in allbook
>do WhatWithAllbook("?What?") && A function to process the lookup results
>skip
>enddo
>
>You have your random cursor and "allbook". What in "Random" is used to look up something in "AllBook"? What has to happen when that "something" is found in "AllBook".
>
>You code looks aokay - but it doesn't explain the rules of engagement between "random" and "allbook"! Tell us about that and maybe we can move it forward!
>
>>hi all,
>>
>>any idea , help,
>>
>>i need to get random records and compare this random records with another table Accumulated Table(allbook1), between 2 date as
>>
>>thisform.text1.value=startdate
>>thisform.text2.value=enddate
>>
>>*i need to enclude this code
>>
>>INSERT INTO dncc ; &&RANDOMLY 2401 RECORDS BETWEEN 2 DATE
>>SELECT * FROM afm char3 NOT IN (SELECT account FROM allbook1)
>>-----------------------------
>>
>>USE afm
>>total = "2401"
>>RAND(-1)
>>INDEX ON RAND() TO SYS(2023)+'\RANDOM'
>>COPY TO dncc NEXT &total
>>SET INDEX TO
>>ERASE SYS(2023)+'\RANDOM'
>>      CLEAR EVENTS
>>ELSE
>>   =MESSAGEBOX("no file/ or data")
>>ENDIF
>>
>>
>>THANKS
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform