Subject Re: date problem in appending from Excel
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 5 Mar 2021 11:06:22 +0200
Newsgroups dbase.getting-started
Attachment(s) append_test.pngappend_test.prg

On 2021/03/05 09:21, Akshat Kapoor wrote:

> I am using the following command
> append from attendance.csv delimited with ","
>
> The data in the csv is from a biometric attendance system.
> The dates are in the format yyyy-mm-dd and the dates are inserted fine.
>
> The biggest problem with dates is the formatting issue as pointed out by
> Ken.
>
> The safest format for import export is yyyy-mm-dd. There is no ambiguity
> in this date format.

dBASE 2019 13.20  b2618 (11/26/2019-EN191126) with Windows 10 Pro,
64-bit, version 20H2

Strange. On my computer dates in the CSV file must be in the format
yyyymmdd otherwise [append from ... delimited] simply ignores them

A little test program and a screenshot of the output are attached.

Mervyn.



if file('append_test.dbf')
drop table append_test
endif

if not file('append_test.dbf')
   create table append_test  (d1 date,d2 date,d3 date,d4 date,d5 date)
endif

f = new file()
f.create('append_test.csv')
cStr= '2021/03/05,03/05/2021,2021-03-05,03-05-2021,20210305'
f.puts(cStr)
f.close()

use append_test
append from append_test.csv delimited
clear
?set('date')
list
use