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
Can't find Outlook contacts folder
MS Office Picture Manager doesn't open images attached to emails
How to link a signature image to a web page in Outlook 6 signature
Connection issues with server....
OCS Client error when trying to expand Distribution list members
How do I share a list across an entire site collection?
HELP! Can't Get My Wifi To Work On IBM Thinkpad
MS Access Query Error when executed from VBA with DMAX() function
Techincal windows based questions to be answered by windows gurus?will you guys?
Attach-Detach vs. Backup-Restore database ?