jjlbmcnews
IS-IT--Management
Hi,
Can any one tell me what is wrong with this query as I can't see what the QA is complaining about! I keep getting incorrect syntax near >.
DECLARE @Country INT
DECLARE @Language INT
DECLARE @PubType VARCHAR(1000)
DECLARE @CountryID INT
DECLARE @LanguageID INT
SELECT Account AS 'BriefCode', Custom1 AS 'Status', COUNT(*)
FROM [dbo].[Distribution] AS D
LEFT JOIN [dbo].[ReadingSource] AS R ON D.PubID = R.iReadingSourceID
WHERE (Custom4 = ' ' OR Custom4 like '@Date%')
AND (1 = CASE @Country WHEN @Country > 0 THEN r.iCountryID = @CountryID WHEN @Country < 0
THEN r.iCountryID <> 1 ELSE NULL END)
AND (1 = CASE @Language WHEN @Language > 0 THEN r.iLanguageID = @LanguageID WHEN @Language < 0
THEN r.iLanguageID <> 1 ELSE NULL END)
AND (1 = CASE @PubType WHEN @PubType <> '' THEN r.iTypeID IN {@PubType) ELSE NULL END)
Can any one tell me what is wrong with this query as I can't see what the QA is complaining about! I keep getting incorrect syntax near >.
DECLARE @Country INT
DECLARE @Language INT
DECLARE @PubType VARCHAR(1000)
DECLARE @CountryID INT
DECLARE @LanguageID INT
SELECT Account AS 'BriefCode', Custom1 AS 'Status', COUNT(*)
FROM [dbo].[Distribution] AS D
LEFT JOIN [dbo].[ReadingSource] AS R ON D.PubID = R.iReadingSourceID
WHERE (Custom4 = ' ' OR Custom4 like '@Date%')
AND (1 = CASE @Country WHEN @Country > 0 THEN r.iCountryID = @CountryID WHEN @Country < 0
THEN r.iCountryID <> 1 ELSE NULL END)
AND (1 = CASE @Language WHEN @Language > 0 THEN r.iLanguageID = @LanguageID WHEN @Language < 0
THEN r.iLanguageID <> 1 ELSE NULL END)
AND (1 = CASE @PubType WHEN @PubType <> '' THEN r.iTypeID IN {@PubType) ELSE NULL END)