SSIS Error : Error at Write intermediary data [Derived Column ] : The function "DATEDIFF" does not support the datatype "DT_WSTR" for parameter number

I am trying to calculate the datediff logic using derived column.
(DT_DBDATE) "2014-01-31" < ((DT_DBDATE) [maturityDate]) ? NULL(DT_DBDATE)  :  DATEDIFF( "d","2014-01-31",((DT_DBDATE) [maturityDate]) )

but this is giving me error, maturity date is also datetime datatype.i am getting the following error.





Solution :  @[User::DataDate] > maturityDate || ISNULL(maturityDate) ? NULL(DT_NUMERIC,10,3) : DATEDIFF("dd",(DT_DBTIMESTAMP)@[User::DataDate],(DT_DBTIMESTAMP)maturityDate) / 365.25






Comments

Popular posts from this blog

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces