Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to replace this ?
Message
 
À
19/01/2005 11:49:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00978598
Message ID:
00978614
Vues:
30
One way is (If You only have AAA... and BBB... code)
REPLACE ALL Desc2 WITH IIF(LEFT(Code,3)=="AAA", "GOOD","BAD")
But If You have more CODEs and want to replace all Codes with LEN bigger then 3 with the value of the Main record (that with LEN = 3)
SELECT * FROM MyTable WHERE LEN(ALLTRIM(Code)) == 3 INTO CURSOR cTemp
SELECT cTemp
INDEX ON LEFT(Code,3) TAG cTemp
SELECT MyTable
SET REATION TO LEFT(Code,3) INTO cTemp
REPLACE ALL Desc2 WITH cTemp.Dec1
USE IN cTemp
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform