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.
Joe Frisbie
21
Reputation points
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.
Accepted answer
1 additional answer
Sort by: Most helpful
-
Joe Frisbie 21 Reputation points
2022-02-04T16:38:23.503+00:00 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.