Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Substr() not working correctly
Message
 
To
16/09/1999 15:16:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00265612
Message ID:
00265631
Views:
18
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform