Hi,

I am trying to import a csv file which looks something like the following:

Client ID;Name;Created On
998;???;2004-06-01 12:38:43
999;???;2005-10-06 12:45:15

1) When I try to create a new table the columns are automatically identified: Client id as Integer, Name as Text and Created On as Date and Time yyyy-mm-dd hh:mm. The datetime format is wrong (missing the seconds) and (probably as a result) the respective SQL statement contains only NULLs for that value.

INSERT INTO {import_ct_clients} (ClientID, Name, CreatedOn) VALUES(998,'???',NULL);

2) When I try to use just "Date and Time" for the "Created on" column, the sql import statement misses quotes around the datetime values (which means the sql exection fails).

INSERT INTO {import_ct_clients} (ClientID, Name, CreatedOn) VALUES(998,'???',2004-06-01 12:38);

3) When I adjust my data and drop the seconds (so a row looks something like this: 998;???;2004-06-01 12:38) then the result is the same as in the first case, I only get NULLs in the sql insert statements.

Regards,
Ben

Comments

kartelusm’s picture

I will look into it today or tomorrow and will get back to you.

bforchhammer’s picture

Note in case anyone else has the same problem: when it's used with the migrate module a workaround seems to be to simply set the respective columns to the "Text" format; the migrate module seems to be able to still translate them into datetime-values for nodes or comments.

kartelusm’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.