Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create and update filed with selected records
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
MS SQL Server
Miscellaneous
Thread ID:
01311271
Message ID:
01311372
Views:
16
>boris, It is possibel if filed long 200 character but trim if
>a string is only long 190.Auto trim
>like your codes
>
CAST(" id#"+Alltrim(code)+" Name"+Alltrim(Name)+" Fname"+Alltrim(fname)+ " Level"+Alltrim(lcode)+ " Sec"+Alltrim(sec) as CHAR(200)) AS NewField;
>if text is short than 200, and it is long 190, and trim the empty space.

If you have only one record in the result then yes, you could use the expression w/o CAST. But If you have more than one you SHOULD CAST() the expression to some value. That is because VFP define the length of the column based on the first record in result set, so if the first record contains narrowest expression all other records will be truncated.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform