Hi I have one doubt in ssis
I want change date format m/d/yyy hh:mm:ss to yyyy-mm-dd using ssis expression
and DatFormat variable dataype is string and getting format like 5/28/2019 12:00:00 AM
data comes like below:
5/28/2019 12:00:00 AM
based on above values i want
output in other variable
2019-05-28
I tried like expression
(DT_STR, 4, 1252) DATEPART("yy" , @[User::DateFormat]) + "-" +
RIGHT("0" + (DT_STR, 2, 1252) DATEPART("mm" , @[User::DateFormat]), 2) +
"-" + RIGHT("0" + (DT_STR, 2, 1252) DATEPART("dd" , @[User::DateFormat]), 2)
but getting error like below :
ADDITIONAL INFORMATION:
The function "YEAR" does not support the data type "DT_WSTR" for parameter number 1. The type of the parameter could not be implicitly cast into a compatible type for the function. To perform this operation, the operand needs to be explicitly
cast with a cast operator.
Evaluating function "YEAR" failed with error code 0xC0047089.
The function "YEAR" does not support the data type "DT_WSTR" for parameter number 1. The type of the parameter could not be implicitly cast into a compatible type for the function. To perform this operation, the operand needs to be explicitly
cast with a cast operator.
can you please tell me how to write expression to achive this task in ssis