Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALLTRIM syntax not support with SQL Server
Message
 
 
To
10/04/2003 08:13:08
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00775890
Message ID:
00775957
Views:
16
>>LTrim() will remove the leading blanks. LTrim(RTrim()) Will remove leading and trailing blanks.
>
>Ok, using:
>
>
>SELECT LTRIM(RTRIM(STR(YEAR(AddDate)))) FROM News
>
>
>will work either in VFP or for SQL Server. However, this creates some extra spaces at the end of each field for that expression. I do however have the same in VFP. In order to avoid that, I have to use:
>
>
>SELECT SUBSTR(LTRIM(RTRIM(STR(YEAR(AddDate)))),1,4) FROM News
>
>
>which, of course, don't work in SQL Server. It must be too early for me here. What am I missing?

Hi Michel,

I don't see any extra spaces running that select. Anyway, you can try
SELECT STR(YEAR(AddDate),4) FROM News
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform