|
Rank: Member
Joined: 6/4/2019 Posts: 13 Location: Trieste
|
Hello All, I have a csv file where a date is in this format: MM/DD/YYYY and I'm trying to insert it in a SQL Database to a column of datetime2 format. to do that I use parseDate passing as format [M,2]/[D,2]/[Y,4] but I get Type Mismatch The value '06/01/2019' is not of type 'date'
I tryed also with formatDate (which receive a string) but the problem is the same.
Any idea?
|
|
Rank: Advanced Member
Joined: 6/16/2006 Posts: 486 Location: AT
|
I can't explain why you're getting exactly this error message, but for a "datetime2" column, you could try if parse-dateTime instead of parse-date works for you.
|
|
Rank: Member
Joined: 6/4/2019 Posts: 13 Location: Trieste
|
found the problem, the column was declared as Date. Changed to String and parsed it as date.
|
|
Rank: Member
Joined: 6/4/2019 Posts: 13 Location: Trieste
|
Ok, Sorted out the problem on transforming from string to date but now when I try to insert the data in MSSQL database the code generated is:
INSERT INTO [Mytable] ([Rcvd_DateTime]) VALUES (2019-09-12T15:44:47.007+02:00)
Testing it in _Sql management studio I have an error on T15:, which is the best way to write this type of data in the db ?
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 564
|
Try date-from-datetime or substring-before("T").
|
|
guest |