Microsoft
Software
Hardware
Network
Question : TSQL CASE and the WHERE CLAUSE
Hi There,
I'm having difficulty trying to get my case statement in the where clause. This is what I am trying to do ..
Select bla bla
FROM bla bla
WHERE
case
when @Letter = 'TEST' then jn.PRINTED = 0 and jn.cust = 'ABC'
when @Letter = 'TEST1' then jn.PRINTED = 0 and jn.cust = 'XYZ'
else jn.PRINTED = 0 and jn.cust = 'XXX'
end
But I am getting a syntax error, can someone help with where I'm going wrong please?
TIA, Roger
Answer : TSQL CASE and the WHERE CLAUSE
Select blabla
FROM bla
WHERE
( @Letter = 'TEST' AND jn.PRINTED = 0 and jn.cust = 'ABC' )
OR
( @Letter = 'TEST1' AND jn.PRINTED = 0 and jn.cust = 'XYZ' )
OR (jn.PRINTED = 0 and jn.cust = 'XXX' )
Random Solutions
Copied all vb files (..vb file, project, solution, user options) for a project but getting errors.
How to upload a new version of the PDF file - Sharepoint Services 3.0?
IIS 7.5 FTP - 530 User cannot log in, home directory inaccessible
can I resell Windows Home Server OEM after 1 months use
Silverlight: open excel in Browser
Format Image with VBA
Screen Resolutions
Access SQL Query Error 3079: Specified field could refer to more than one table listed
FLICKERING LISTBOX - MS ACCESS 2003
Empty Strings and Null String