SSRS report #To parameters - reporting-services

I need last Sunday date with whole day time count. By using this
DateAdd(DateInterval.Day, -0,DateAdd(DateInterval.Day, 1-Weekday(today),Today)
I am getting time As 12AM, but I need all day time.

Related

SSRS Expression for getting current week Sunday-Saturday

I am looking to make a report that gets the current week from sunday to saturday, i was thinking oh the headers of it having the date of the current week of running the report, does anyone know how to do that?
I assuming what you are asking is how to filter your dataset to show only records within the same week as the current week?
if so then you can do something like this
=WEEK(today()) = WEEK(Fields!myDateField.Value)
This will return True if the week is in the same week as the current week.
For more info on the WEEK function see here
https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2008/aa337345(v=sql.100)

SSRS Report Parameters Start date to be set for Friday when Current day is Monday

I have a report parameters start date and end date both set for previous day. I have report subscription that runs on each day of the week. But, when it executes on Monday, I need to change the Default parameter to run from the Prior Friday's date thru Sunday. How can I achieve this? TIA
I just replicated your use case locally.
For your start date parameter you will need expression as below. It will check if today is Friday (Weekday starts from Sunday) then set start date as Friday from last week else previous day. This shall work.
=IIF(WeekDay(today)=2,DateAdd("d",-3,today),DateAdd("d",-1,today))

subscription contains parameter values that are not valid

I have a report with begin date and end date parameters and is specifically meant for subscription that should serve 2 types of subscriptions:
1, One for previous fiscal week -->Begin date is first day of previous fiscal week and end date is last day of previous fiscal week.
2, One for previous day -->Begin date is previous day and end date is also previous day.
Dataset Datefields:
This is the dataset query results for both date parameters available and default values.
When I create subscription for previous day it only runs that day...after midnight that day, begin date and end date parameter values are blank and the subscription fails with a status message "The subscription contains parameter values that are not valid" values.
Subscription created for previous fiscal week is good for a week until the values previous fiscal week start and end dates change.
You are using a dataset for defaults and values for date parameters, which probably isn’t the best approach.
The way I have handled reports that I want to allow end users to subscribe to, and have the default date values vary depending on whether subscription was a daily, weekly, or monthly one, is to have an extra parameter that makes this possible.
The parameter I add to the report is one I call Period (or Report Period), and it has to be the first parameter in the report, or at least listed before the date parameters. The only values in the dropdown for this parameter are Daily, Weekly, and Monthly (if applicable). These can be whatever you need. Enter these manually as value options in the parameter in the report, since they are not expected to change very often. Based on what the end user chooses for this parameter when creating a subscription, the default date values change. This is done via an expression in the default value for the date parameters that evaluates the value chosen from the Period dropdown.
So, if the end user wants a daily subscription, they choose Daily from the Period parameter dropdown, and the default values for the start and end date parameters change to only include the prior day. If they choose Weekly, the start and end date parameters change to only include the prior week, and so on.
Here is an example for the start date parameter default value expression.
=Switch(Parameters!Period.Value = "Daily" , DateAdd(DateInterval.Day, -1, Today),
Parameters!Period.Value = "Weekly" , DateAdd(DateInterval.WeekOfYear, -1, DateAdd(DateInterval.Day, -(DatePart(DateInterval.Weekday, Today, 0, 0)-1), Today)) ,
Parameters!Period.Value = "Monthly" , DateAdd(DateInterval.Month, -1, DateAdd(DateInterval.Day, -(DatePart(DateInterval.Day, Today, 0, 0)-1), Today)))
For the end date parameter…
=Switch(Parameters!Period.Value = "Daily" , Today,
Parameters!Period.Value = "Weekly" , DateAdd(DateInterval.Day, -(DatePart(DateInterval.Weekday, Today, 0, 0)), Today) ,
Parameters!Period.Value = "Monthly" , DateAdd(DateInterval.Day, -(DatePart(DateInterval.Day, Today, 0, 0)), Today))
Warning!! Changing the Period value either in the report designer (preview), or online, will not cause the date values to automatically change right before your eyes. It will while creating (and thus executing) a subscription, however. I have never looked into why this is. I have other, less painful, things to fill my time.
Give this a try.

SSRS - Report Builder 3.0 - This Day Last Year

I'm trying to get a Today vs This Day Last Year Comparison Report sorted.
I set a 'From' and 'To' date based on a 'Preset' parameter.
So if it is set to 'This Week' it sets the start date to Monday and the end date to Sunday.
What I want now is a Today vs This Day Last Year. So for example, if i were to do it for today, I would get 09/04/2015 vs 10/04/2014. So as today is Thursday, I want the nearest Thursday from 09/04/2014.
Also want the same for 'Yesterday'. So 08/04/2015 vs 09/04/2014
Is there a way to do this in either the Parameters SSRS expression, or within the custom 'Code' section?
To get this day last year, you can just subtract 52 weeks from today. Try this expression: =DateAdd("ww",-52,Today()). Likewise you can subtract 1 day from today to get yesterday: =DateAdd("d",-1,Today()).

ssrs expression to calculate number of worked days in particular month

i need to calculate the number of worked days in a particular month. i have start date and end date depending on this i have to calculate the worked days in particular month. in ssrs report please help me with a ssrs expression to solve the problem.
i have a logic to do this but how to do it in a SSRS expression is a problem.
the logic is:
if(start date is in January than
start date-31/1/2014)
//this will give me the worked days in January
if(start date is not in January
start date-1/1/2014 //this gives me working days till January
(total working days)-( start date-1/1/2014)//this gives me working days after January 1
if((total working days)-( start date-1/1/2014)>31
then my answer is 31 days worked in January.
i have to convert this logic in to ssrs expression, is it possible?
is there any alternate way to do this ?
please help me with this.