[RESOLVED] MS SQL - Where IN using a coalesce
Hi
Nice and simple question:
Why won't it work ? ;)
Code:
...
WHERE table.pkid = 1
AND COALESCE(table.field, '') IN ( '','D' )
I have data, this particular field is null. Without this coalesce line it brings back the rows. With it it brings back nothing.
Is the IN clause filtering the data before the COALESCE is applied?
Re: MS SQL - Where IN using a coalesce
I don't know but try isNull(table.field,'').
Re: MS SQL - Where IN using a coalesce
Nah I got it - I was being silly and added a NOT to the line. Something from the previous statement I was changing. It negated everything, so all ok. Sorry to have bothered you with this :)
Thanks for the suggestion