in SSRS, @Month populates @StartDate and @EndDate, how to hidde @StartDate and @EndDate

Hi, in the report, I have created
1)@Month,
Dataset query:
select  MonthName FROM [MMD_Feed].[dbo].[Calendar]
  where  datepart(yyyy,getdate())=left(EndDate,4)
order by MonthNumber asc

2)@StartDate
Dataset query:
select StartDate  FROM [MMD_Feed].[dbo].[Calendar]
where  MonthName= @MonthName and datepart(yyyy,getdate())=left(EndDate,4)

3)@EndDate
Date query:
select EndDate  FROM [MMD_Feed].[dbo].[Calendar]
where  MonthName= @MonthName and datepart(yyyy,getdate())=left(EndDate,4)

What I want:
in the report, the end user can  see @Month only, so @StartDate and @EndDate will be hidden. When the end user select @Month = March for example, @Month will populate @StartDate = 2015-02-1 and @EndDate = 2015-03-31. In the report, all the tables will show the data from 2015-02-1 to 2015-03-31.

My problem:

I had to make @Month, @StartDate and @EndDate visible in the report parameter setting, so the report can run correctly.
If I configure @StartDate and @EndDate to hidden or internal, the report shows the error message " the 'StartDate'Parameter is missing a value"

So How Can I hide @StartDate and @EndDate to make the report run correctly?

Thank you in advance!
Capture.JPG
tanj1035Asked:
Who is Participating?
 
tanj1035Author Commented:
Thanks, Arnold. In my report, the dataset of each table contains @startdate and @enddate in where clause already.
I worked it out and want to share with everyone.
In @StartDate and @EndDate parameter setting:
in general : choose hidden
in default value: choose get value from query
"select StartDate  FROM [MMD_Feed].[dbo].[Calendar]
 where  MonthName= @MonthName and datepart(yyyy,getdate())=left(EndDate,4)"

So the @StartDate and @EndDate are hidden but still can pass the value to the tables.

Thanks!!
0
 
arnoldCommented:
What is the data in the report, you can use the start and end dates in the where clause, but you are not required to include them in the select
0
 
tanj1035Author Commented:
I figured it out.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.