Derived column expression to add #days to date during import

  • I have a SSIS package which imports data from a flat (CSV) file into SQL database.

    During the import I need to add 6 days to a column called Date.

    I have added a derived column transformation and entered the expression:

    DATEADD(day, 6, Date)

    but it doesn't like it - 'attempt to find the input column "day" failed'

    Is there something wrong with the syntax? Is this the right way of doing this or is there a better way?

  • Hi

    I guess this is the problem with data type.

    When u define the flat file connection manager, in the Advance tab, you define the columns , data types and lenght of each column of the falt file.

    Usually when we define the flat file connection, all columns are defined as string data types.

    So change the data type of period column to Date. Then your problem will be solved.

    Regards

    Bindu

  • The data type is date already [DT_DATE] - I used the 'suggest types' option.

  • It was just a syntax error - missing "'s on the datepart!

    DATEADD ("day", 6, Date)

    It works now

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

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