EasyMorph breaks when trying to load datetimeoffset values to a sql table

Hi,

We have a stored procedure that reads a sql table. There are 2 dates that are of DATETIMEOFFSET(7) data type. When EasyMorph tries to export that data from the sp into the sql table on it’s destination sql server, it gives the error:

Error: Export of row #1 failed with the following error: Conversion failed when converting date and/or time from character string.
Source: action “Export to database”, table “Lakeland Data”

Anyone have some advice on how to resolve this?

Hi @EasyMorphNewbie,

Since EasyMorph doesn’t have a dedicated data type for datetime with offset values, the Export to database action doesn’t support the DATETIMEOFFSET column type. As a workaround, you can convert you datetime values to a text datetime with offset literal (for example, 2023-07-08 12:34:56+07:00) and export those text values to the DATETIMEOFFSET column.

Thank you for the response. Here’s what I did. Once I read the data in from the sql db table, I added a convert datatype action, selected the 2 dates with the datetime offset, Convert “Everything to Text” Number Format: “yyyy-MM-dd HH:mm:ss” from the drop down selection, Keep Original value. That worked. Not sure if there’s a better way, but it got me passed my error. Hope this also helps others. I wasn’t 100% clear on what you were saying, but I think this is what you were saying :slight_smile:

1 Like