According to https://learn.microsoft.com/en-us/sql/reporting-services/tutorial-add-a-parameter-to-your-report-report-builder, try replacing -60 (or just 60) with @NumberOfDays.
SQL Query:How to use a variable for number of days in a DATEADD expression.
I am not so good at SQL, however, I am trying to take a DATEADD expression we use in an SCCM SSRS report
"Where GSWS.[LastHWScan] >= DATEADD(DAY, -60, GETDATE()) "
And change the -60 entry to use a variable "@NumberOfDays" we prompt for when running the report.
Sign in to comment
1 additional answer
Sort by: Most helpful
Thank you all, it works. Now I have to understand how to add the variable as a dataset in SSRS to put it all together.
Hi @Joe Frisbie ,
Helped convert Viorel-1's comment as answer.
As Viorel-1 said, you may replace -60 with @NumberOfDays.
If this helps on your issue, you could mark it as answer so other user with similar problem could see this easier. :)
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.
Helped convert Zoehui-MSFT's response to comment, as it should be