Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT with SPACE() question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00469200
Message ID:
00469212
Vues:
11
>>I can’t get this right.
>>I want to SELECT and at the same time make the field longer.
>>Let say the field is 1 char long. I want to select it into my updateable cursor and make it 6 char long
>>
>>SELECT charfield FROM Cursor && will give me just the one char long as it is, so I tried:
>>SELECT SPACE(charfield,6) FROM Cursor && and lots of other variations and I can’t get it to work
>>There has to be a way to do this!
>>Suggestions?
>
>Try:
SELECT PADR(ALLTRIM(charfield), 6) as charfield...
FYI, you don't need the ALLTRIM(). PADR will pad the value if shorter or truncate it if longer than the specified length.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform