October 16, 2008 at 11:50 am
Hello all, I'm looking to convert the following IIf statement to a CASE statement. I didn't see anything in the forums that might give me some direction. If there is a post with guidance would you point me in the right direction.
((IIf([StudentStatus] <> "Active", IIf([EnrollmentLDA] Is Null, "N", ""), "") )<>"N")
Thank you much,
Z
November 14, 2008 at 1:25 am
Did you post the entire expression? The inequality test at the end does not seem to fit.
Anyway, here's an example you could try:
case
when[StudentStatus] <> 'Active'
then
case
when[EnrollmentLDA] Is Null
then'N'
else''
else''
end
ML
---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com
November 14, 2008 at 9:37 am
Matija, thanks for the response. No, the entire expression was not posted just this snippet. I was looking for a way to convert this to a CASE statement. I tried a couple of different ways but no luck. Think I just needed another set of eyes on it.
Thanks again,
Z
November 14, 2008 at 11:20 am
So, does it work as expected? 😉
ML
---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com
November 14, 2008 at 11:46 am
Not sure. I'll test and post back in a few days.
Cheers,
Z
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply