Need to convert date into string literal in SSIS

  • I need to convert date into string literal in SSIS in derived column.How is it possible.

    Example:

    Input-2013-01-07 00:00:00.000

    Output-07012013

    Please guide me in achieving this in SSIS.

    Thanks in advance

  • manibad (2/27/2013)


    I need to convert date into string literal in SSIS in derived column.How is it possible.

    Example:

    Input-2013-01-07 00:00:00.000

    Output-07012013

    Please guide me in achieving this in SSIS.

    Thanks in advance

    Just off the top of my head, try an expression like:

    RIGHT("0" + (DT_WSTR,2)DAY(GETDATE(),2) + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE(),2) + (DT_WSTR, 4)YEAR(GETDATE())

    HTH,

    Rob

  • Here's another option:

    SUBSTRING((DT_WSTR,10)(DT_DBDATE)GETDATE(),6,2) + SUBSTRING((DT_WSTR,10)(DT_DBDATE)GETDATE(),9,2) + SUBSTRING((DT_WSTR,10)(DT_DBDATE)GETDATE(),1,4)

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

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