Skip to content


Failed To Convert parameter value from a string to a datetime

Tanya Henderson asked 2 years ago
I am having an issue with a date format for a CSV text file. 
If the scheme is set to date we do not see the date in the file. 
If we change it to char or integer we see the date and it is in the following format yyyyMMdd.
We added the field to the date field in the map and we get the following error:
Failed to convert parameter value from a string to a DateTime.
I have tried Convert.ToDateTime and it then causes another error so I am not sure what to enter to convert the date.  I have also tried the blog post that is the bug from Excel with no success.
We are importing into Dynamics GP and help would be greatly appreciated.
Lorren Zemke Staff answered 2 years ago
SQL doesn’t understand how to interpret the string in the format yyyyMMdd so you will have to use a calculated field to change it.
return _FIELDNAME.Substring(0,4) & “-” & _FIELDNAME.Substring(4,2) & “-” & _FIELDNAME.Substring(6,2)

If you would like to submit an answer or comment, please sign in to the eOne portal.