NOT IN + if structure
Hi folks,
I would like to implement the following statement in my report.
AND (CASE WHEN @afwezig ='T'
THEN b.tnr_opname NOT IN
(SELECT tnr_opname
FROM r00aanafw
WHERE datum_van < convert(DateTime,'01/01/2001',103) AND (datum_tot > convert(DateTime,'01/01/2001',103) OR datum_tot is null))
When the parameter equals T, then the field b.tnr_opname shouldn't be in the following select-statement, else there shouldn't happen anything. This code doesn't work. Help me please!
Thx mates

