I'm trying to sum & count for my last year values
I have two parameters in report one is StartDate, and 2nd EndDate
When I choose these two dates so its showing me values as current, so if I choose StartDate - 01/11/2016 and EndDate - 10/11/2016 so I want to compare 01/11/2015 - 10/11/2015 values so I can compare last years values as well.
So when someone change the parameters dates then it show me last year and current values. I've done current one just struggling last year expression.
Related
Title might not be worded the greatest.
Anyway, I have a report and I am trying to set a field where a user can enter an amount of days they want subtracted from today's date.
Ex. The report gets data from July 4 to July 4, if they enter 7 in this parameter, it takes the end date and subtracts 7 from it so they get a week's data.
What is the best way to do this?
In my report I want to populate date parameter automatically. on daily bases date need to be select previous day (today()-1) , but on Monday it need to select Friday date.
please help me to write a function around this
I have date parameter in my report.
You can achieve this using Weekday(). Make sure the parameter has the Date/Time data type, and use this expression as the default value:
=DateAdd(DateInterval.Day,
IIF( Weekday(Today(),0) = 1, -3, -1),
Today())
The function Weekday(Today(),0) will equal 1 when today's date is a Monday. If true, you subtract three days from today's date to get the previous Friday. If not, you subtract 1 to get yesterday.
Consider given 2 dates between 2015-01-01 and 2015-01-30, I need to find the dates for every Monday and every Sunday during that period.
I have a report, the user needs to select a date range, and from the date range it calculates each first-day-of-week and last-day of week and passes it in that way.
How it currently works in SSRS is
exec storedprocname
#BD=N'798211,798654,798664,798826',
#CGNo=N'47',
#SCGNo=N'4701,4702,4703,4704,4705,4706,4707,4708',
#ProductClass=N'1,2,4,3',
#ProductCode=N'1020',
#Region=N'772',
#FirstDayOfWeek='2014-01-06 00:00:00',
#LastDayOfWeek='2014-01-12 00:00:00'
User selects multiple Mondays and Sundays, the report is a matrix table and matrix's on first day of week
FirstdayOfWeek = '2014/06/09,2014/06/16'
LastdayOfWeek = '2014/06/15,2014/06/23'
What I need is a date range the user selects this and it will still pass it in the same way
#startdate '2015/01/01' = Thursday (for this select current week's Monday)
#startdate '2015/02/01' = Sunday
You can use SSRS inbuilt function WEEKDAYNAME
=WEEKDAYNAME(DATEPART("dw", Fields!myDate.Value)
OR
=WEEKDAYNAME(DATEPART("w", Fields!myDate.Value)
You can use weekdayname function to filter your dataset or matrix or use in Iff expression.
If you want to handle it in SQL Server you can use dataname function.
I have a SSRS report which is executed and delivered daily to emails. The report calculates some numbers for the 1st date of the month to the (d-1)th date (d being the day when it is executed). So the default parameter values in this report are :
Start_date :=DateSerial(Year(Date.Now), Month(Date.Now), 1)
End_date :=DateAdd("d",-1,Today())
The problem is on 1st of every new month , the start date evaluates to 1st of new month and the end date becomes the last date of previous month. This makes the report non-sensical on 1st of every month.
What should we do to avoid this and force the expression to evaluate 1st of the new month as start and end date ?
For the End Date, perhaps check if it's the 1st of the month and then default to the current date (i.e. the 1st) if it is:
=Iif(
Day(DateTime.Today) = 1,
DateTime.Today,
DateAdd("d",-1,DateTime.Today)
)
But I'm assuming there is a reason your are using today-1 as the end date, so this could mean your report shows nothing for the 1st day of the month...
I have created one report where i want to pull the records from specified date range
I have two parameters i.e. StartDate and EndDate. Both are date/time data type.
What I want to do is set the default date for the StartDate parameter as +7 days from today's date, and have the EndDate as +7 days from the StartDate?
Basically the reports need to show everything for the following week
E.g. If the report is created today (Monday 22nd Sept); it would show data between Monday 29th to Sunday 5th.
Please let me know how I would specify this as an expression under the parameters, or could this be done within the DataSet?
Put the StartDate Parameter's default value as =now.AddDays(7)
And EndDate Parameter's default value =Cdate(Parameters!StartDate.value).AddDays(7)