Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert Date
Message
De
24/09/2008 00:26:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
23/09/2008 20:38:08
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01350071
Message ID:
01350100
Vues:
28
>>>Is there a simple way to convert this:
>>>
>>>"2002/01/23"
>>>
>>>to this?
>>>
>>>"01/23/2002"
>>>
>>>It actually starts out as this:
>>>
>>>"20020123"
>>>
>>>If that matters.
>>
>>How about
>>ab="20020123"
>>SET CENTURY on
>>SET DATE american
>>? CTOD(TRANSFORM(ab,"@R ^9999-99-99"))
>
>How can I work that into this?
>
>NewFormatValue = EVALUATE("ALLTRIM(TRANSFORM(CHRTRAN(FormatValue,CharactersToStrip,''), '@R ####/##/##'))")
>
>Where FormatValue is:
>
>"20020123"
>
>I'm not trying to get the date, but rather the text value.

That should have worked for your string - and for a date as well; the Set Date wasn't there for the transform(), it was for the CTOD. You could avoid the Set Date by using
eval(transform(ab,"[^9999-99-99")+"}")
And you can simply put your FormatValue instead of ab and that'd be it - and Set Date independent too. The eval() would return a date value, which you can then output any way you like.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform