Greetings,
My crystal reports datasource is a stored proc (SQL server 2005) that expects 2 parameters:
@startDate varchar,
@endDate varchar
These are converted to a datetime in the stored proc as follows:
W.WeekEnd >= Convert(datetime, @startDate, 20)
When I set the stored proc as the datasource it prompts for values for both fields which I enter as follows:
2011-08-01 00:00:00
2011-08-17 00:00:00
This results in the error
Conversion failed when converting datetime from character string.
In t-sql if I run the exact same command in the stored proc it runs and returns a date e.g.
Select Convert(datetime, '2011-08-01 00:00:00', 20) as RobsTime
2011-08-01 00:00:00.000
Hope someone can advise me of why the error is occuring, I'm baffled.