derived column error

  • hi,

    i am getting error while putting the following expression in SSIS.

    Here IsLogistics and TradePeriodStart are two columns coming from the query above in the derivedcolumn.

    I want to replace TradePeriodStart

    ([IsLogistics]=="Y")&&(CONVERT(VARCHAR,DATEADD(dd,-(DAY(TradePeriodStart)-1),TradePeriodStart),111)<

    CONVERT(VARCHAR,DATEADD(dd,-(DAY(GETDATE())-1),GETDATE()),111))? CONVERT(DATETIME,CONVERT(VARCHAR(10),DATEADD(DD,-(DAY(GETDATE())-1),GETDATE()),23)+' 00:00:00.000'):TradePeriodStart

  • You're using SQL Server functions and datatypes. They do not exist in SSIS, so you'll need to use the ones that SSIS provides.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I also tried select ([IsLogistics]=="Y")&&(dateadd(m, datediff(m, 0, TradePeriodStart), 0))<(dateadd(m, datediff(m, 0, getdate()), 0))?TradePeriodStart:TradePeriodStart but did not work

  • I suggest you read the help files of all the ssis functions that you want to use.

    For example:

    http://msdn.microsoft.com/en-us/library/ms141719.aspx

    In the examples you can clearly see that you need to put double quotes around the datepart argument.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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