Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
didio
Starting Member
7 Posts |
Posted - 2001-07-17 : 10:10:16
|
| Hi,Can somebody see what I'm doing wrong here?I get this error if I supply 1 or 2 in the @sort variable.If I supply 3 then its working.Error:Syntax error converting datetime from character string.SP:CREATE PROCEDURE sptest @Sort intASSELECT R.ResourceID, R.ResourceName, R.ShowDetails, C.CategoryName, R.Locked, R.[Date]FROM tblResources R LEFT OUTER JOIN tblCategories C ON R.CategoryID = C.CategoryIDWHERE (R.SiteID = 1)ORDER BY CASE WHEN @Sort = 1 THEN R.ResourceName WHEN @Sort = 2 THEN C.CategoryName WHEN @Sort = 3 THEN R.[Date] ELSE R.[Date]END DESCGOThanks. |
|
|
|
|
|