November 25, 2011 at 12:28 am
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
November 25, 2011 at 1:57 am
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
November 28, 2011 at 9:47 pm
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
November 28, 2011 at 11:38 pm
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