I am using SSIS 2012 with VS 2013. I have variable defind as a SQL statement with this where clause. When I run the package I keep getting the message "Incorrect syntax neat the keyword 'And'.". If I evaluate the expression within the project and run it in SSMS it runs just fine. Does anyone see anything wrong with this Where clause? All the variables have defined values.
WHERE YEAR(a.TRXDATE)*10000+MONTH(a.TRXDATE)*100+DAY(a.TRXDATE) >= " + @[User::FiscalPeriod] + (@[User::LoadFuturePer]
== "Y"?";":" And YEAR(a.TRXDATE)*10000+MONTH(a.TRXDATE)*100+DAY(a.TRXDATE) <= " + @[User::CurrentPeriod] + ";")