Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
USE dbPubMatrixSELECT A.CapId, ISNULL((select 0),0) as Arval_2, ISNULL((select CASE WHEN A.capid = 0 THEN 0 ELSE a.price),0) as Arval_3, ISNULL((select 0),0) as Arval_4 FROM dbPubMatrix..vwtxtmatches A WHERE A.CapId IN (0,46412,42594,42595,46410,46411,42608,42609)
Line 4 has a syntax error, something wrong with the CASE statement, can anyone help?Thanks
rocknpop
Posting Yak Master
201 Posts
Posted - 2010-07-05 : 06:12:05
missing END:CASE......END--------------------Rock n Roll with SQL
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2010-07-05 : 06:20:19
[code]SELECT CapID, 0 AS Arval_2, CASE CapID WHEN 0 THEN 0 ELSE ISNULL(Price, 0) END AS Arval_3, 0 AS Arval_4FROM dbPubMatrix.dbo.vwTxtMatches WHERE CapID IN (0, 46412, 42594, 42595, 46410, 46411, 42608, 42609)[/code]N 56°04'39.26"E 12°55'05.63"