Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The number in Replicate creates a problem
Message
From
05/04/2022 08:23:29
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01684050
Message ID:
01684068
Views:
28
>>>Good point. I did what you suggest and the value in the column for LEN(ALLTRIM(REFERENCE)) shows the actual number of characters in the field. And yet, when I REPLICATE with the 10-.... or 15--... it does not work.
>>>Thanks
>>
>>
>>SELECT REFERENCE, Cast(REPLICATE(' ',15-LEN(ALLTRIM(REFERENCE))) + ' ' AS c(100)) as TEST FROM WO_REFER
>>
>
>Strange results. When I do the CAST() as you suggested and leave the number in REPLICATE to be 15, the resulting column TEST has the correct number of the 'nbsp'. That is, if the value in the field is 'A', the value in the TEST is 14 strings of 'nbsp'
>But if I change the 15 with 10, error "String too long to fit"

Strange. Try to change c(100) to c(150), just to test. Or c(200).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform