Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PADL() equivalent in SQL Server
Message
De
10/04/2003 10:19:50
 
 
À
10/04/2003 10:14:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00776019
Message ID:
00776038
Vues:
22
>>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
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform