SSRS Returns Wrong End Date Parameter

  • Hi i have this problem with my date parameter:

    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 portal send the parameter FromDate and ToDate, ToDate is wrong.It returns ToDate from URl plus adds one more day

    It gives me 24/06/2016 21:58:59.

    Why?

  • passing date as parameter is a very basic and usual working however, try to select the parameter in the t-sql and see what you are getting in return?

  • In t-sql and Reporting Services is ok, when i manually put date from URL, but when i get ToDate from URL and pass that date to ToDate parameter in Reporting services it adds one more day.It's a little bit strange.Thats why i need help

  • what i meant was USE your parameter in the report source something like this:

    Select @FromDate as FromDate, @ToDate as ToDate

    and use FromDate & ToDate column as a source and see what your report shows. If your fromdate is not getting effected then only your todate is getting effected, better checked the expression in the report, is there any piece of code which adding 1 date in the parameter value.

    because if there would be an issue, it should be the same for From date as well. right??

  • So i used parameters Fromdate and Todate in report like text boxes, and i get FromDate as i want to get it, but ToDate is wrong calculated. I don't use any expression in my data source .I have only @ToDate [@ToDate]

  • can you share some more detail when you say something like

    i get FromDate as i want to get it

    you do you are getting this date from ???

    any my question remains the same, If both are datetime datatype why only ToDate is affected. why not FromDate.

    For testing purpose, try the following:

    1. Added a new parameter in report, lets say SampleDate.

    2. Pass the same date which you are passing to ToDate.

    3. Check the value of this new SampleData parameter in the report.

  • Ok it's like this. I have store procedure in my background that i use it and i call that store procedure in my data set. Also i have one web page from where i click on a button and url is passed to the reporting services and than report is exported in Excel file. URL is

    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

    The same names from the url are in the report , FromDate and ToDate. When i test that report i create 2 test text boxes and put FromDate and ToDAte parameters to see what i get back when parameters are passed from web page to my reporting services.

    So it's very strange that FromDate parameter is correct and ToDate is not.I don't use any expression in report, just use parameters from web page and from store procedure)they are the same).

    But when i just play with parameters in Reporting services and chose From and ToDate the result is ok.Only problem is when i get those parameters from web page

  • Well, try to pass the ToDate without timestamp data.

    i.e instead of

    ToDate=2016-06-23%2021:59:00

    try this

    ToDate=2016-06-23%2022:00:00

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply