How to convert dt_str to a yyyy-dd date format with derived columns

Micki Arruda 1 Reputation point

I have a dt-str coming in from a text file. it is a 6 character date yyyydd. I need the destination to be date yyyy-dd. I tried the code below, but it adds an 01 for the day at the end, making it 8 characters.


I appreciate the help with this.

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

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 24,806 Reputation points

    Hi @Micki Arruda ,

    (1) The DATE data type shall be always in the following format: yyyy-MM-dd.

    It is based on the ISO 8601 standard: iso-8601-date-and-time-format

    (2) You can check the official SSIS documentation too:

    DT_DBDATE A date structure that consists of year, month, and day.

    Link: integration-services-data-types

    0 comments No comments

  2. ZoeHui-MSFT 30,881 Reputation points

    Hi @Micki Arruda ,

    As YitzhakKhabinsky-0887 said that the DATE data type should be yyyy-MM-dd.

    So we just can convert the 6 character date yyyydd to DT-STR yyyy-dd.

    Don't forget to click Accept Answer so that we could archive the case.



    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.
    Hot issues October

    0 comments No comments