Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL problem with SUBSTR
Message
From
03/09/2002 14:56:02
 
 
To
03/09/2002 13:56:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00696315
Message ID:
00696341
Views:
9
I can't say if it's related, but I recently had a mysterious problem using Substr() in a select statement. It returned nothing at all from the field (it was a memo field). I solved it by simply substituting Left(cVar, nLength) for Substr(cVar, 1, nLength). I don't know if it will work for you, but I'd be interested to know.

Just try changing the portion of your code from:
SUBSTR(objectname, 1, AT(".", objectname) - 1)
to:
Left(objectname, AT(".", objectname) - 1)
I know it makes no sense, but for what it's worth, Left() worked perfectly for me while Substr() did not.

Alan

>Has anybody encountered an error in using SUBSTR() with SELECT-SQL code?
>
>select IIF("." $ objectname, ;
> SUBSTR(objectname,1,AT(".",objectname)-1), objectname), ;
> from childtable
>
>This code returns only up to 7 characters. I noticed that if the objectname before the period is greater than 8 chars., it outputs only 7 characters. My examples are objectname="specsupus.free","special.free","address1.free","disc.free".
>
>The statement above returns
> specsup
> special
> address
> disc
>
>Is there any flag that affects this output that I should set to ON or OFF?
>
>Thanks a lot for th ehelp.
>
>Nerissa
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform