I've installed SQL Server 2000 on my new laptop and Crystal Report XI, out of sudden, the Crystal Report to certain view can't run and I got the following error:
Details: 22007 [Microsoft][ODBC SQL Server Driver][SQL SERVER]Syntax Error cnverting character string to smalldatetime data type.
Any suggestions?
Hannah
Request clarification before answering.
Can you post the code that you are using ?
That would help us to provide any suggestions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the view the err is complaining about:
SELECT TOP 100 PERCENT Cur.Closed_Month, Cur.Closed_Year, Cur.Incidents_Closed, Prev.Incidents_Closed AS PrevIncidents_Closed,
YrAgo.Incidents_Closed AS YearIncidents_Closed
FROM (SELECT Closed_Month, Closed_Year, Incidents_Closed
FROM dbo.Incidents_Closed) Cur INNER JOIN
(SELECT Month(CONVERT(datetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 32) AS PrevMonth,
year(CONVERT(datetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 32) AS PrevYear,
Incidents_Closed
FROM dbo.Incidents_Closed) Prev ON Cur.Closed_Month = Prev.PrevMonth AND Cur.Closed_Year = Prev.PrevYear INNER JOIN
(SELECT Month(CONVERT(smalldatetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 366) AS PrevMonth,
year(CONVERT(smalldatetime, CAST(closed_month AS varchar) + '/01/' + CAST(closed_year AS varchar), 101) + 366) AS PrevYear,
Incidents_Closed
FROM dbo.Incidents_Closed) YrAgo ON Cur.Closed_Month = YrAgo.PrevMonth AND Cur.Closed_Year = YrAgo.PrevYear
What confused me is that it works fine with my previous laptop. I wonder if there is any patch in Crystal Report or SQL server that used to support certain functions but not support them anymore....
Thanks
Hannah
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.