SSRS Returns Wrong End Date Parameter - reporting-services

From my internet page/portal I generate my report:
http://localhost/BOPortal/Reports/View/Events?FromDate=2016-06-22%2022:00:00&ToDate=2016-06-23%2021:59:00&Language=en-GB&User=admin
When it is run the ToDate parameter is wrong. It gives me the date from the URL plus one day 24/06/2016 21:58:59.
Why?

Related

How can I change the date format of a date/time SSRS parameter - this is specific to en-SC culture?

I have an SSRS report that has a start and end date parameter (set to the date/time type) so that the user can choose the date range. The report sets the Localization Language value based on a parameter that is passed in at run time.
This works great for en-GB but we have a customer in the Seychelles and when the localization is set to en-SC, the date format of the 2 parameters defaults to mm-dd-yyyy, but this is incorrect as the date format should be dd-mm-yyyy. Because of this, the user is unable to set the dates correctly as choosing the 31st January for example gives a 'The value provided for the report parameter 'startdate' is not valid for its type' error.
When I drop down the date picker and pick 31st January, it fills the date in as 31/01/2023 but then displays the error. I have my Windows Region set to "Seychelles" and Regional Format to "English (Seychelles)".
Is there anything I can change to get this to work or is it a bug in SSRS?

SSRS expression: If string then associated date field

I tried all kinds of variations of the following in my ssrs expression:
=iif(Fields!varchar.Value = "ABC20", Fields!StartDate.Value,Nothing)
It either yields the False clause, the first date field, or it shows as #Error when debugging.
The data type of StartDate is Date (Format= yyyy-mm-dd). Your help in resolving this is much appreciated.

Today() and Now() functions return Modified Date instead of current DateTime in SSRS

I am using the "Today()" function as the default value in SSRS parameters to set start and end date ranges. On the reports that have been deployed these parameters are returning the date the report was deployed (Modified Date) instead of today. On text boxes or labels that use the Today() expression it is returning today correctly.
I know that i can get default values from a query (GetDate()), but I'd like to use Today() as it was intended...

Error when trying to DATEADD milliseconds in SSRS

So I have an enddate parameter in my report and I have the following code under Default Value to get me the last day of the previous month.
=DateAdd("d", -1, DateSerial(Year(Now()), Month(Now()), 1))
This works fine, returning 04-30-2016. That's fine and dandy but when I go to use the Subscription piece in SSRS it has the datetime field as: 04-30-2016 12:00:00 AM. So I tried doing the following to my code to have it shave off three milliseconds:
=DateAdd("ms", -3,DateAdd("d", 0, DateSerial(Year(Now()), Month(Now()), 1)))
When I try to run my report I get the following error:
The DefaultValue expression for the report parameter "enddate" contains an error: Argument 'Interval' is not a valid value. (rsRuntimeErrorInExpression)
How do I fix this error and get my report running as it should?
The AddMilliseconds function will work for you in this case.
=DateAdd("d",-1,DateSerial(Now.Year,Now.Month, 1)).AddMilliseconds(-3)
This gives you the last day of the previous month substracting three milliseconds.
Let me know if this helps.

Comparing todays date against first day of the week

I am trying to set a default parameter value in SSRS report. I want to test the current date to see if it equals the first day of the week (in my case Monday). If it is the first day of week, then I want the default value to be current date minus 2 days, if it is not the first day of the week then I want the default value to be current date minus 1 day.
I seem to have a syntax problem but it doesn't tell me where. My parameters are StartDate and EndDate.
this is what I've tried:
=iif(weekday(Today(),FirstDayOfWeek.Monday)==1,DateAdd("d",-2,today(),DateAdd("d",-1,today())
this is the generic error I get:
The value expression for the report parameter 'StartDate' contains eror:[BC30201] Expression expected.
Where am I going wrong?
You are trying to use Sql syntax in a SSRS VBA expression. SSRS VBA allows very similar expressions for date manipulation to Sql, the main difference being the use of the DateInterval enum.
So your expression needs to use VBA syntax:
=IIF(Weekday(Today, FirstDayOfWeek.Monday) = 1, DateAdd(DateInterval.Day, -2, Today), DateAdd(DateInterval.Day, , -1, Today))
It appears that you are missing a closing parentheses after the first logical part of the if statement and another to close the statement.
=iif(weekday(Today(),FirstDayOfWeek.Monday)==1,DateAdd("d",-2,today()),DateAdd("d",-1,today()))