Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appe from csv not recognizing date
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01334224
Message ID:
01334300
Views:
12
Thanks Yuri.
I used another solution by appending as a text field and then doing a CTOD
Regards,
Gerard


>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform