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
What are the relative merits of using "On Format" and "On Print" events in an Access Report?
ODBC and VBA
PerfMon.exe
Windows 2008 R2 cannot resolve SIDs
Fill Text Boxes with Text when Another Text Box equals a Specific Value
Compatible Windows Server 2000 SATA Controller?
Installer for WinForm Application written in C# .net 2.
I added a record and cannot see it in the form
RDP 7 Audio Compression - Latency
Why can't I write files to the root of my C drive?