Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appe from csv not recognizing date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01334224
Message ID:
01334231
Vues:
11
>Hi.
>I am using Append from Myfile.tx type csv and one of the fields is a date field
> in format dd/mm/yyyy e.g. 31/12/2008
>I have Set date british but any dates with a day greater than 12, its importing incorrectly,
> as if its set to US date format
>
>Is there any way to import British dates from CSV file ?
>
>Regards,
>Gerard

Try this:
lcfile=CSV_file_full_path

sqlsetprop(0,'DispLogin',3)
store SQLSTRINGCONNECT(;
	'DefaultDir='+addbs(justpath(lcfile))+';'+;
	'Driver={Microsoft Text Driver (*.txt; *.csv)}');
	TO gnConnHandle
if gnConnHandle <=0
               * no connections
              return
endif
lc=set("date")
set date british
?SQLEXEC(gnConnHandle, "SELECT * from "+justfname(lcfile), "tmpcrs")
=SQLDISCONNECT(gnConnHandle)
set date (lc)

sele 0
use (your_table)
append from (dbf("tmpcrs"))
Good Luck
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform