I have an SSIS package and I have this SQL query in a variable.
@[User::start_date] and @[User::end_date] are two variables in the package and I can get them successfully but when it runs this query I get this error: "conversion failed when converting datetime from character string"
Can you plz tell me what's wrong here?Thanks alot, SQL_user
You need to use SUBSTRING function to convert it to desired format before assigning and ISDATE() function before converting to datetime. Moreover, It will purely be dependent upon the input. If I assume the input is in YYYYMMDD format then it could be
If you can tell us what kind of input you are expecting then we may lead to better approach.