convert the WSTR value to date in ssis

Naresh y 146 Reputation points
2022-02-08T13:04:12.64+00:00

Hi have a string column in which dates are there , i would like to send the rows into to the date column

the below error i found it,how do i convert this wstr value to date using data conversion transformation

[OLE DB Destination [40]] Error: There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[LostDate] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value could not be converted because of a potential loss of data.".

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,451 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Naresh y 146 Reputation points
    2022-02-08T13:47:04.33+00:00

    Date column

    20211010
    20211010
    20211010

    0 comments No comments

  2. Yitzhak Khabinsky 24,941 Reputation points
    2022-02-08T17:20:56.11+00:00

    Hi @Naresh y

    Please try the following expression:

    (DT_DBDATE)(SUBSTRING([column_name],1,4) + "-" +  
     SUBSTRING([column_name],5,2) + "-" + SUBSTRING([column_name],7,2))  
    
    0 comments No comments

  3. ZoeHui-MSFT 32,586 Reputation points
    2022-02-09T01:41:51.773+00:00

    Hi @Naresh y ,

    Right click, Show Advanced Editor in the Data Conversion.

    And then Goto Input and Output Properties---Expand Data Conversion Output and click on the date column---Set FastParse to True in the Custom Properties.

    parsing-data

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments