Hi,I'm trying to set a few additional clauses to the where section of a Select, depending on the type of profile selected but I'm getting a syntax error (Incorrect syntax near '=') when checking my code. Does anyone know what I'm doing incorrectly or what is missing? Here's a sample of my code for two profiles:DECLARE @FromDate DATETIME, @ToDate DATETIME, @Currency VARCHAR(5), @Profile VARCHAR (50), @Where INT, @Where1 VARCHAR (500), @Where2 VARCHAR (7999), @Where3 VARCHAR (500), @Where4 VARCHAR (500)SET @FromDate = '2010-10-01 00:00:00'SET @ToDate = '2010-10-05 23:59:59'SET @Profile = '10-BAC-3RD-GBP'SELECT CASE WHEN @Profile = '10-BAC-3RD-GBP' THEN @Where1 = ' AND fdTradingPartne.TPType NOT IN (''10'', ''13'', ''14'', ''23'', ''50'')' @Where3 = ' AND (fgSrcDoc.OpenAmt > 0.0 OR fgSrcDoc.OpenAmt < 4999.0)' @Where4 = ' AND fdBnkCodSub.BankValue IS NULL' WHEN @Profile = '10-BAC-3RD-GBP-ANW' THEN @Where1 = ' AND fdTradingPartne.TPType NOT IN (''10'', ''13'', ''14'', ''23'', ''50'', ''23A'')' @Where3 = ' AND fgSrcDoc.OpenAmt > 0.0' @Where4 = ' AND fdBnkCodSub .BankValue = ''MPP'''END
thank you in advance