Is the variable property EvaluateAsExpression set to true?
Put a breakpoint on the preexecute event of the Execute SQL Task and check the value of the SQL query in the locals window.
Last option: use profiler to see what statement is sent to the database.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP