Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PADL() equivalent in SQL Server
Message
 
 
To
10/04/2003 10:19:50
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00776019
Message ID:
00776081
Views:
29
>>>Something like this?
>>>
Select IsNull(Replicate(' ', 20 - len(SomeField))) + SomeField as SomeName from SomeTable
>>
>>I've been trying various combinations such as:
>>
>>
>>SELECT IsNull(Replicate(' ',20-len(STR(MONTH(AddDate)))))+STR(MONTH(AddDate)) FROM News
>>
>>
>>but, can't make anything work.
>
>Ok, I'm getting close. The following returns the proper value but it returns it in a memo field:
>
>
>SELECT REPLICATE('0',2-LEN(LTRIM(STR(MONTH(AddDate)))))+LTRIM(STR(MONTH(AddDate))) FROM News
>
Try
SELECT REPLACE(STR(MONTH(AddDate),2), ' ', '0')
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform