SSRS Error

  • Hi

    I have a TSQL statement which runs fine in SSMS but when i try creating a dataset with it in SSRS I get the following error message:

    The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

    I'm confused why it would run in SSMS without an error but not in SSRS.

    Any ideas what the problem might be and how I should go about resolving it?

    Cheers

    BO

  • are you using parameters to pass in dates?

  • Could be your report localisation doesn't like the format in your string,

    e.g. 03152012 = 15th March 2012 in US, 3rd ???? 2012 in UK.

  • Cheers for responding so quickly...

    No, there are no paramaters in the report...

  • in that case its best to pass in date times as date times not varchars, so you can either cast or convert them to an ISO date format in the procedure/query block so that no matter what your locale is the T-SQL will work as intended.

  • Cheers Anthony

    Yes, casting it as a date does the job.

    Thanks for your help.

Viewing 6 posts - 1 through 5 (of 5 total)

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