March 15, 2012 at 8:34 am
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
March 15, 2012 at 8:38 am
are you using parameters to pass in dates?
March 15, 2012 at 8:44 am
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.
March 15, 2012 at 8:45 am
Cheers for responding so quickly...
No, there are no paramaters in the report...
March 15, 2012 at 8:50 am
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.
March 15, 2012 at 8:57 am
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