CAST VARCHAR date to datetime at load

  • Hi

    im doing an OLE DB load from a table with time date field stored as a nvarchar , this is the field that im using to compare with my lastload variable for an incremental load. when the comparison is run i get an "The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value." error i would normally add a SET DATEFORMAT DMY to the sql but with inclusion of a parameter i get a parse error. Im a bit stuck i only want to pull in only the records since the last load but i need to cast the comparison which is thowing the error?

  • Hi

    Please check

    1. The locale settings for the server, typically happens if you passed date as MM/DD/YYYY and should be DD/MM/YYYY (or vice versa).

    2. Nvarchar values are less than 1753-01-01 or/and greater than 9999-12-31.

    Best regards

    Mike

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply