Reputation: 1
I have a report with StartDate and EndDate date parameters but when I pass it through the report builder, it doesn't seem to map the EndDate param. I know this is because of the IF block at the beginning however I've used this in a previous report without issue.As you can see from this image, although this is not the exact query this has the same issue.
Is there a way around this, or is there a way to update the parameter within an expression to get around the IF block?
Upvotes: 0
Views: 958
Reputation: 2951
The problem is that you have SET the end date. If you want the report to use both the parameter, you need to unset it.
But if all you are looking for is to check if they are the same and set the end date parameter, then you need to do that in the where clause
Select *
from your table
Where you_column between @start_date and case when @end_date = @start_date then dateadd(day,1,@start_date) else @end_date end
Upvotes: 1