I am using ssis expression to add a day to a project parameter. Project parameter and out put variable both are string datatype. Please see below code
SUBSTRING((DT_STR,30, 1252) DATEADD("dd",1,(DT_DBDATE)@[$Project::Proj_End_Date]), 1, 10)
The above is working fine when date passed as "2017-03-10" but it is failing when the Proj_End_Date value is blank. I am getting this below error.
TITLE: Expression Builder
Expression cannot be evaluated.
------------------------------ ADDITIONAL INFORMATION:
Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_DBDATE.
Casting expression "@[$Project::Proj_End_Date]" from data type "DT_WSTR" to data type "DT_DBDATE" failed with error code 0xC00470C2.
Evaluating function "DATEADD" failed with error code 0xC00470C4.
Casting expression "DATEADD("dd",1,(DT_DBDATE)@[$Project::Proj_End_Date])" from data type "DT_DBTIMESTAMP" to data type "DT_STR" failed with error code 0xC00470C5.
Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_DBDATE.
Casting expression "@[$Project::Proj_End_Date]" from data type "DT_WSTR" to data type "DT_DBDATE" failed with error code 0xC00470C2.
Evaluating function "DATEADD" failed with error code 0xC00470C4.
Casting expression "DATEADD("dd",1,(DT_DBDATE)@[$Project::Proj_End_Date])" from data type "DT_DBTIMESTAMP" to data type "DT_STR" failed with error code 0xC00470C5.
Evaluating function "SUBSTRING" failed with error code 0xC00470C4.
(Microsoft.DataTransformationServices.Controls)
------------------------------ BUTTONS:
OK
User contributions licensed under CC BY-SA 3.0