Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date conversion
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00634946
Message ID:
00634960
Vues:
18
>Hello All,
>
>I'm adding records from a .dat file (saleco.dat) I'm receiving, into a vfp table.
>
>I've got the file structure pretty much set up but am having issues with converting what should be date data to my vfp table.
>
>The saleco.dat file appears to be storing the date data in a character type field (foaldate) with 6 digits (ie; "051290","060425")
>
>I'm assuming that "051290" should convert to {^1990/05/12} and "060425" should convert to {^1925/06/04}.
>
>I added a new field (date type - "datefoal") to the vfp table and tried to do a conversion to replace the new date field with the data in the "foaldate" field but am not having any luck.
>
>"replace all datefoal with ctod(foaldate)" does not work.
>
>Does anyone have any ideas on how this can be accomplished.
>
>TIA,
>
>Jim Harvey

Jim,

Something like
replace datefoal ;
    with date(	iif(val(substr(foaldate,5,2))<=10, 2000, 1900) + val(substr(foaldate,5,2)), ;
		val(substr(foaldate, 1, 2)), ;
		val(substr(foaldate,3,2)) ;
	    ) ;
	all
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform