Share via

SSIS Expression

dinesh 41 Reputation points
2020-11-06T05:56:31.84+00:00

Hi, I'm looking for help on SSIS expression. I am passing month and year values to sql query expression.

"WHERE extract(year from INSERTDT) = @[User::BatchYear] and extract(month from INSERTDT) = @[User::BatchMonth] and
TO_CHAR(jdate, 'yyyy')>1900"

I'm getting missing expression. Batchyear and batchmonth are int.

SQL Server Integration Services
0 comments No comments

Answer accepted by question author

Monalv-MSFT 5,926 Reputation points
2020-11-06T07:24:38.993+00:00

Hi @dinesh ,

Please store the sql query in the ssis variable. And then pass the value of the month variable and year variable to the sql query variable in the expression.

Please see the following pictures:

37927-variables.png

37974-expression.png

37975-oledbsourceeditor.png

Best Regards,
Mona

----------

If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues in October--Users always get connection timeout problem when using multi subnet AG via listener. Especially after failover to another subnet.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.