Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Substr() not working correctly
Message
 
À
16/09/1999 15:16:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00265612
Message ID:
00265631
Vues:
19
>I have a table called pnltemp. The store column is defined as CHAR(4). I am wanting to scan through the entire table and strip off the leading character. I am using the following code, but for some reason it is not working properly (does it for maybe 4 of the 70 entries):
>
>
>SELECT pnltemp
> SCAN
> store2 = substr(alltrim(store),2,3)
> REPLACE store with store2
> ENDSCAN
>
>
>
>PLEASE HELP!!!!

Providing the leading character is always the left most character, try:

Store2 = RIGHT(Store, 3)

Even better try:
SELECT pnltemp
REPLACE ALL Store WITH RIGHT(Store, 3)

but only if you test it first!
Oct 31 = Dec 25
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform