PDA

View Full Version : SQL Enterprise Manager (View) IIF Then



hatched850
01-12-2009, 03:01 PM
:help
I am soooo new at working with this software, I was wondering if there was a way to do an if then statement in the view. Such as
IIF(ISNULL([person]),N,Y)

What I want it to do is if the field is blank to put N and if it is not blank I want a Y.

Let me just say that I wanted to create a new data column with this information.

:cuckoo:

stanl
01-12-2009, 05:46 PM
I think you have to use CASE...ELSE

IIF(ISNULL([person]),N,Y)


becomes something like...
CASE WHEN [Person] IS NULL THEN 'N' ELSE 'Y' END

Stan