Unable to format date using format string MM-dd-yyy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2021 09:13 AM
I am currently trying to set up a data import from an SQL database, and I am running into transform errors relating to the date field when attempting to transform the data to the table. Each row has the same error, so here is one example:
Unable to format 08/01/2019 using format string MM-dd-yyyy for field date
I don't understand why this is happening, as when I look at the data being brought in on the import set table, the date field looks just fine. I had a similar problem on another import, but changing the date format didn't help like it did with that one. Any thoughts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2021 11:35 AM
remove that field from mapped fields and add below in the script of the transform map
var sdate = new GlideDateTime(source.your field here); //your field here will be from SQL DB
target.your field here = sdate.getDisplayValue(); //your field here will be field in ServiceNow table