Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with query

Status
Not open for further replies.

jjlbmcnews

IS-IT--Management
Oct 4, 2001
60
GB
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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top