Current week as default week in the SSRS report
Hi All,
How to write expression for default value to get the current week.
at present I am passing the values from the Query.
So I would like to set up a default value when I open the report it should run on current week without selecting from the drop dow list.
Now we have weeks like this
201201
201202
201203
-----
------
Could anyone tell how to write the expression for default value to get the current week
Thanks,
Rama
July 16th, 2012 9:15am
First Day of Current Week
Note: Monday is first day of Week
=DATEADD("d", 1 - DATEPART(DateInterval.WeekDay, Today(),FirstDayOfWeek.Monday), Today())
Last Day of Current Week
Note: Monday is first day of Week
=DATEADD("d" ,7-DATEPART(DateInterval.WeekDay,Today(),FirstDayOfWeek.Monday),Today())
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2012 9:19am
Use the following expression. Please replace DateField with your field name.
=CStr(Year(Fields!DateField.Value))+CStr(DatePart(DateInterval.WeekOfYear, Fields!DateField.Value))
=CStr(Year(Fields!DateField.Value))+CStr(DatePart(DateInterval.WeekOfYear, Fields!DateField.Value))
Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 16th, 2012 9:26am
Thanks for your information
=DATEADD("d", 1 - DATEPART(Parameters!RetailWeek.Value.WeekDay, Today(),FirstDayOfWeek.Monday), Today())
I did try this but it is showing unrecognize at 'weekday'
where is the wrong
THanks,
Rama
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2012 9:30am
Did you try the expression I posted above?Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 16th, 2012 11:34am
I have paramter values like this
201201
201202
based on these I need to get the default week
... I dont have any dates
is that possilbe ?
Thanks,
Rama
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2012 11:40am
=CStr(Year(Today()))+CStr(DatePart(DateInterval.WeekOfYear, Today()))
Try the above expression...Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
July 16th, 2012 11:44am