Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Damn Converting Dates
Message
De
03/10/2008 14:50:55
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
03/10/2008 14:13:53
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01352632
Message ID:
01352658
Vues:
30
I did this, but is there a better way?
CASE FormatFieldValue = 'MMDDCCYY'
	NewFieldValue = EVALUATE("ALLTRIM(TRANSFORM(DTOS(FieldValue), '@R " + REPLICATE('!',FieldLength) + "'))")
	NewFieldValue = SUBSTR(NewFieldValue,5,2) + SUBSTR(NewFieldValue,7,2) + SUBSTR(NewFieldValue,1,4)
>I'm having trouble getting the NewFieldValue to evaluate to the correct character value. Can someone give me an example of what I need to do in one of the CASE conditions?
>
>
>FieldValue = {^2008/01/01}
>
>DO CASE
>	CASE FormatFieldValue = 'CCYYMMDD' && Should be "20080101"
>		NewFieldValue = EVALUATE("ALLTRIM(TRANSFORM(DTOS(FieldValue), '@R " + REPLICATE('!',FieldLength) + "'))")
>	CASE FormatFieldValue = 'MMDDCCYY' && Should be "01012008"
>		NewFieldValue = EVALUATE("ALLTRIM(TRANSFORM(DTOS(FieldValue), '@R " + REPLICATE('!',FieldLength) + "'))")
>	OTHERWISE && Leave it alone other than converting to text
>		NewFieldValue = EVALUATE("ALLTRIM(TRANSFORM(DTOS(FieldValue), '@R " + REPLICATE('!',FieldLength) + "'))")
>ENDCASE
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform