locked
Default parameters (In Report Manager) doesn't work RRS feed

  • Question

  • I get error in Report Manager. Because of following issue I can not implement Linked Reports.

    I am using Sql Server 2005 Standard Edition SP2.

    When I set parameters with default values and I get error message as "Conversion failed when converting datetime from character string."

    Parameters:

    1) From Date  (String datatype, Default value set as "=Now.AddDays(-3).ToShortDateString")

    2) From Time (String datatype, Default value set as "12:00 AM")

    3) To Date (String datatype, Default value set as "=Now.AddDays(-1).ToShortDateString")

    4) To Time (String datatype, Default value set as "12:00 AM")

    The same report when deployed with Visual Studio works fine with default parameters. I mean if I set default values from Visual Studio, the report works fine in Report Manager. But If I deploy that report and change default values in Report Manager and then try to run with the same default values, it doesn't run. It gives error (error message mentioned above).

    So far I am assuming that it is a bug in SSRS 2005 Standard Edition SP2. I would like to know your expert advice for the same issue.

    Thank you in Advance.

    Sunday, June 20, 2010 2:40 PM

Answers

  • Can you convert VARCHAR(10)  DATETIME? Is that possible Reginal Settings is different on you local machine and server?
    Best Regards, Uri Dimant http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    • Marked as answer by Jerry Nee Friday, July 2, 2010 5:59 AM
    Monday, June 21, 2010 12:20 PM

All replies

  • Hi,

    In expresion you can try using CDATE(), it will solve conversion error.

    Hope this helps.

    -Chintak.

    Sunday, June 20, 2010 4:12 PM
  • Chintak,

    I can not use CDATE() as in stored procedure the FROMDATE parameter is varchar(10).

    Monday, June 21, 2010 12:00 PM
  • Can you convert VARCHAR(10)  DATETIME? Is that possible Reginal Settings is different on you local machine and server?
    Best Regards, Uri Dimant http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    • Marked as answer by Jerry Nee Friday, July 2, 2010 5:59 AM
    Monday, June 21, 2010 12:20 PM