Jul 28, 2011 #1 n36z Programmer Jul 26, 2011 13 US When I run the following query. An error is being thrown "Incorrect syntax near 'columnA'" declare @value1 int set @value1=2 select * from table1 where 0 = 0 AND CASE WHEN @value1>1 columnA ELSE 1 END = 1
When I run the following query. An error is being thrown "Incorrect syntax near 'columnA'" declare @value1 int set @value1=2 select * from table1 where 0 = 0 AND CASE WHEN @value1>1 columnA ELSE 1 END = 1
Jul 28, 2011 #3 Qik3Coder Programmer Jan 4, 2006 1,487 US Code: SELECT * FROM table1 WHERE 0 = 0 [tab]1 = AND CASE WHEN @value1 > 1 [!]THEN[/!] columnA ELSE 1 END Lodlaiden I haz all the letters: SME, BA, QA, PM, DEV, DBA, UAT, SE, HD Upvote 0 Downvote
Code: SELECT * FROM table1 WHERE 0 = 0 [tab]1 = AND CASE WHEN @value1 > 1 [!]THEN[/!] columnA ELSE 1 END Lodlaiden I haz all the letters: SME, BA, QA, PM, DEV, DBA, UAT, SE, HD
Jul 28, 2011 #4 KH75 Programmer Jun 1, 2010 42 CA declare @value1 int set @value1=2 select * from table1 where 1 = CASE WHEN @value1>1 then columnA ELSE 1 END Upvote 0 Downvote
declare @value1 int set @value1=2 select * from table1 where 1 = CASE WHEN @value1>1 then columnA ELSE 1 END
Jul 28, 2011 #5 bborissov Programmer May 3, 2005 5,167 BG Code: WHERE 0 = 0 AND (columnA = 1 OR @value1 < 1) Borislav Borissov VFP9 SP2, SQL Server 2000,2005 & 2008. Upvote 0 Downvote
Code: WHERE 0 = 0 AND (columnA = 1 OR @value1 < 1) Borislav Borissov VFP9 SP2, SQL Server 2000,2005 & 2008.