Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PADL() equivalent in SQL Server
Message
 
 
À
10/04/2003 10:19:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00776019
Message ID:
00776081
Vues:
32
>>>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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform